Skip to content

Instantly share code, notes, and snippets.

@gugod
Created January 19, 2018 13:50
Show Gist options
  • Save gugod/6628cd4a554c86722ce532afe9a6218e to your computer and use it in GitHub Desktop.
Save gugod/6628cd4a554c86722ce532afe9a6218e to your computer and use it in GitHub Desktop.
($a == 1 && $a == 2 && $a == 3)
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