sub scanfile ($) { my $filename= shift; local $/; undef $/; my $handle; open $handle, '<', $filename or croak "can't open file [$filename] + "; return scan (<$handle>); }
Using my in the middle of something is idiomatic in places already, but has always seemed forign to me since I'm used to declarations being separate from expressions. I've not explored the limits of this in detail, so just what is allowed in using my $x where a $x is expected? Is it always legal?
—John
In reply to Code Review on Several Interesting Points by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |