Tell produces a warning (so does stat, -s, -e, etc..) with use warnings
(-w)
perl -wle '
open my $fh, "<", "notexists.txt";
print "can stat fh" if tell $fh
'
tell() on closed filehandle $fh at -e line 1.
-1
The alternatives fileno($fh)
and eof($fh)
do not produce warnings.
I found the best alternative was to save the output from open
.