http://www.perlmonks.org?node_id=870659


in reply to my $var

Have a look at Lexical scoping like a fox