in reply to Improving lexical scoping outside subs

A good idea that a friend introduced me to was using a "MAIN" label. This way you don't have to make a call to a "main" subroutine(this is nice because you can use @ARGV like you normally would), you prevent variables from having too large of scope and you make clear what the main part of your program is. Your script would look something like this:
MAIN:{ my $fn="myfile"; print readfile($fn); } sub readfile { my $out=""; open(FH, $fn) or die "Can't read $fn"; $out .= $_ while(<FH>); return $out; }