Skip to content

Instantly share code, notes, and snippets.

@exodist
Last active August 29, 2015 13:56
Show Gist options
  • Save exodist/8870805 to your computer and use it in GitHub Desktop.
Save exodist/8870805 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
my $foo = "hello\n";
$a = undef;
$b = undef;
EVIL:
$foo = $a if $a;
eval "goto $b" if $b;
sub speak { print $foo };
my $foo = "bye\n";
speak();
print $foo;
$a = "Blah!\n";
$b = "GOAWAY";
goto EVIL;
GOAWAY:
speak();
exit;
__END__
"my" variable $foo masks earlier declaration in same scope at temp.pl line 15.
hello
bye
Blah!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment