- or download this
/home/alex>perl -Mstrict -w -E 'say fileno(STDERR) ? "Filehandle" : "N
+A"'
Filehandle
...
NA
/home/alex>
- or download this
/home/alex>perl -Mstrict -w -E 'open my $f,"<","/dev/null"; say fileno
+($f)'
3
...
0
/home/alex>
- or download this
/home/alex>perl -Mstrict -w -E 'my $f="foo"; say defined(fileno($f)) ?
+ "filehandle" : "not a filehandle"'
not a filehandle
...
filehandle
/home/alex>
- or download this
/home/alex>perl -Mstrict -w -E 'say fileno(STDERR); say fileno("STDERR
+"); say fileno("stderr"); say fileno("foobar")//"undef"; say fileno($
+_)//"undef" for (qw( STDERR stderr foo ))'
Name "main::foobar" used only once: possible typo at -e line 1.
...
/home/alex>