Skip to content

Instantly share code, notes, and snippets.

@ErinCall
Created August 9, 2011 22:10
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 ErinCall/1135337 to your computer and use it in GitHub Desktop.
Save ErinCall/1135337 to your computer and use it in GitHub Desktop.
lexical scope in if-block in perl
§ perl
use strict;
if (0) {
my $foo = 'albertsons';
}
print "->$foo<-"
Global symbol "$foo" requires explicit package name at - line 5.
Execution of - aborted due to compilation errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment