open(FH,'>test.txt') or die "$!\n"; my $obj = { S => *FH{IO} }; print {$obj->{S}} "foo\n";