my $foo; sub bar { # lots o' code $foo++; # more code } sub baz { # do a few laps around the pool ($foo) = (split)[2]; # shower and go home } #### sub versive { # some pushups while ( my ($key,$value)= each %data ) { # process things } # }