- or download this
open my $foo, ">&=STDOUT"; $foo = *$foo{IO}; print ref $foo
- or download this
select(select(my $foo)); $foo = *$foo{IO}; print ref $foo
- or download this
{ package FileHandle; use overload q[""]=>sub {"string me!"} }
select(select(my $foo)); $foo = *$foo{IO}; print "$foo";
- 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.