LoginSignup
1
0

More than 5 years have passed since last update.

Perl で (a == 1 && a == 2 && a == 3) を true にしてみる

Posted at

Perl だと Morichan さんが諸々書いていますね!

自分が書いたのは tie を使ったパターン

package Incr;
require Tie::Scalar;
@ISA = qw(Tie::StdScalar);

sub FETCH { ++$$_[0] }

package main;
use Test::More tests => 1;

tie my $a, Incr, 1;
ok $a == 1 && $a == 2 && $a == 3;

Stackoverflow にあった回答に近い雰囲気かな

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0