# $foo and $bar are not accessable outside of this scope { my ($foo, $bar) = qw(Hello world); DoSomething(); } # this is outside of the above scope so it can not access $foo and $bar sub DoSomething { print "$foo $bar\n"; } #### # $foo and $bar are not accessable outside of this scope { my ($foo, $bar) = qw(Hello world); DoSomething(); # this is inside the scope so it can access $foo and $bar sub DoSomething { print "$foo $bar\n"; } }