perldoc -f my A "my" declares the listed variables to be local (lexically) to the enclosing block, file, or "eval". #### $ perl use strict; use warnings; { package one; my $var = 1; } { package two; my $var = 5; } package main; print "$var\n"; Global symbol "$var" requires explicit package name at - line 16. Execution of - aborted due to compilation errors.