Skip to content

Instantly share code, notes, and snippets.

@yappo
Created May 6, 2011 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yappo/958407 to your computer and use it in GitHub Desktop.
Save yappo/958407 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
no strict 'refs';
*{'even?'} = sub {
return !($_[0] % 2);
};
for my $i (1..10) {
if (&{'even?'}($i)) {
print "$i is even.\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment