http://www.perlmonks.org?node_id=812215

jeanluca has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

I want to store a filehandler in a hash-ref and use it like:
my $s = {} ; open( $s->{out}, ">out" ) or die "hmmmm\n" ; print $s->{out} "test" ; close $s->{out} ;
Looks ok (to me), but doesn't work. If I change this code to
my $s ; open( $s, ">out" ) or die "hmmmm\n" ; print $s "test" ; close $s ;
it works fine.
For some reason 'print' doesn't recognize $s->{out} as a filehandler. Any suggestions ?

thnx
LuCa