#!/usr/local/apps/perl/bin/perl sub foo { # "global scoping" (global allocation, ie: shells) # This scope's $i the same as the global scope's $i $i = 2; print "i = $i\n"; print "i = " . $main::i . "\n"; } $i = 1; &foo; print "i = $i\n";