in reply to How to open() something in a hash?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to open() something in a hash?
by ikegami (Patriarch) on Jan 24, 2009 at 01:08 UTC | |
|
Re^2: How to open() something in a hash?
by jh- (Scribe) on Jan 24, 2009 at 01:21 UTC |