{ package Foo; # now lives in Foo's symbol table $pkg_var = "a string"; use strict; # only lives until the end of the block my $lex_var = "another string"; # set the global var $! (which is why we don't die) open(FH, "non_existant_file"); 1; } package main; print "package var - $Foo::pkg_var\n"; print "lexical var - $lex_var\n"; print "global var - $!\n";