Help for this page

Select Code to Download


  1. or download this
    open my $foo, ">&=STDOUT"; $foo = *$foo{IO}; print ref $foo
    
  2. or download this
    select(select(my $foo)); $foo = *$foo{IO}; print ref $foo
    
  3. or download this
    { package FileHandle; use overload q[""]=>sub {"string me!"} }
    select(select(my $foo)); $foo = *$foo{IO}; print "$foo";
    
  4. or download this
    { package PerlIO::Layer; use overload q[""]=>sub {"string me!"} }
    $foo = PerlIO::Layer->find("raw");
    print "$foo";
    # Update: this only works for 5.8.x (actually only tested on 5.8.2)
    # and not even then if you've built a perl without layers support.