i simplified program following trivial snippet , i'm still getting message
name "main::file" used once: possible typo...
#!/usr/bin/perl -w use strict; use autodie qw(open close); foreach $f (@argv) { local $/; open file, "<", $f; local $_ = <file>; # <--- here close file; print $_; }
which isn't true gets used 3 times. whatever reason, marked occurrence counts.
i aware nicer ways open file (using $filehandle), doesn't pay short script, it? how can rid of wrong warning?
according documentation autodie
:
bugs
"used once" warnings can generated when autodie or fatal used package filehandles (eg, file ). scalar filehandles recommended instead.
i warning on perl 5.10.1, not 5.16.3, there may else going on well.