Skip to content

@rjbs /gist:1350212
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/usr/bin/perl
use strict;
{
package Booloney;
sub new { bless { i => 0 } }
use overload '!' => sub { my $i = (++$_[0]{i}); sqrt $i == int sqrt $i },
fallback => 1;
}
my $x = Booloney->new;
for (1 .. 10) {
my $bool = ! $x;
printf "%s <- %20s \$x\n",
($bool ? 'T' : 'F' ),
join(' ', ('!') x $_);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.