reads from the filehandle $file (which isn't a filehandleYes and no. It's a string being passed to 1-arg open and readline, which are glob contexts. So it's interpreted as a symbolic glob reference (and a glob reference is the typical type of a filehandle), which makes strict complain.
But without strict, it works just fine as a filehandle:
$ perl -we'$file = "foo.bak"; ${"foo.bak"} = "seq 10|"; open $file or +die "nope:$!"; print for <$file>' 1 2 3 4 5 6 7 8 9 10
In reply to Re^2: File Stricture Help
by ysth
in thread File Stricture Help
by MrFloydFreak42
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |