in reply to Having to specify $_
Functions do not assign to $_ by default. Consider
You wouldn't expect that to print 'foo', would you? Well, the while loop doesn't make it any different. You have probably been confused by things like while (<>) {} (which works because <> assigns to $_ by default) and for (@list) {} which works because for will use $_ by default when an iteration variable isn't named.sub foo { 'foo' }; foo(); print $_,"\n";
-sauoq "My two cents aren't worth a dime.";
|
|---|