Created
January 19, 2018 13:50
-
-
Save gugod/6628cd4a554c86722ce532afe9a6218e to your computer and use it in GitHub Desktop.
($a == 1 && $a == 2 && $a == 3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
package ObjA { | |
use overload '==' => sub { $_[0][0]++; }; | |
sub new { bless [$_[1]], $_[0] } | |
}; | |
my $a = ObjA->new(1); | |
if ($a == 1 && $a == 2 && $a == 3) { | |
print "Hello World\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment