From
perldoc -f print
Note that if you're storing FILEHANDLEs in an array, or if you're using any other expression more complex than a scalar variable to retrieve it, you will have to use a block returning the filehandle value instead:
Something like:
open(FH,'>test.txt') or die "$!\n";
my $obj = { S => *FH{IO} };
print {$obj->{S}} "foo\n";
grep
|
One dead unjugged rabbit fish later |