Help for this page

Select Code to Download


  1. or download this
      use strict ; use warnings ;
    
    ...
        my $sex = ref($thing) ;
        return $sex ? "ref:$sex" : ref(\$thing) ;
      } ;
    
  2. or download this
      sex($a) =       GLOB and ${*{$a}{SCALAR}} = 127
      sex($b) =   ref:GLOB and ${*{$b}{SCALAR}} = 127
    
  3. or download this
      use strict ; use warnings ;
    
    ...
        my $sex = ref($thing) ;
        return $sex ? "ref:$sex" : ref(\$thing) ;
      } ;
    
  4. or download this
      1________________________________
      open FH, ">&2" ;
    ...
      open $fh, ">&2" ;
        show($fh)        => ref:FileHandle     fileno=7  test=OK     can '
    +autoflush'
        show(*$fh{IO})   => ref:FileHandle     fileno=7  test=undef  can '
    +autoflush'
    
  5. or download this
      open my $FH, ..... ;
    
  6. or download this
      use IO::Handle ;
      open my $FH = new IO::Handle, .... ;
    
  7. or download this
      $STDERR  = \*STDERR ;
      my $DATA = \*DATA ;
    
  8. or download this
      $STDERR  = bless \*STDERR, 'IO::Handle' ;
      my $DATA = bless \*DATA,   'IO::Handle' ;
    
  9. or download this
      no strict ;
    
    ...
        my $FH = shift ;
        print $FH @_ ;
      } ;