Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a question concerning FileHandle.
my $fh = FileHandle->new(">./test"); print $fh "Hello\n";
works just fine, however
$hashref->{"fh"} = FileHandle->new(">./test"); print $hashref->{"fh"} "Hello\n";
does not compile: "String found where operator expected"
Why?
$hashref->{"fh"}->print()
works though.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FileHandle in a Hashref
by toolic (Bishop) on Feb 25, 2011 at 14:36 UTC | |
|
Re: FileHandle in a Hashref
by moritz (Cardinal) on Feb 25, 2011 at 15:45 UTC | |
|
Re: FileHandle in a Hashref
by Marshall (Canon) on Feb 25, 2011 at 14:38 UTC |