Help for this page

Select Code to Download


  1. or download this
    /home/alex>perl -Mstrict -w -E 'say fileno(STDERR) ? "Filehandle" : "N
    +A"'
    Filehandle
    ...
    NA
    
    /home/alex>
    
  2. or download this
    /home/alex>perl -Mstrict -w -E 'open my $f,"<","/dev/null"; say fileno
    +($f)'
    3
    ...
    0
    
    /home/alex>
    
  3. 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>
    
  4. 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>