How are you using the file handle (specific code sample required here!)? The following works for me:
use strict; use warnings; my $str; my $self = bless {}; open $self->{fh}, '>', \$str; my $fh = $self->{fh}; # Perl gets confused unless globs are simple sca +lars print $fh "Hello world\n"; close $self->{fh}; print $str;
Prints:
Hello world
In reply to Re: How to open() something in a hash?
by GrandFather
in thread How to open() something in a hash?
by jh-
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |