my $i=100; # Some code here... ... sub_1 { my $i; # This $i is undefined. It's not the same $i that was defined outside the sub. # Code that uses $i ... } # $i now = 100, as before, since we're not in the sub. sub_2 { my $i = 4; # This $i = 4. print "$i\n"; # Prints 4. } # Once again, $i = 100.