sophate has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am having problem with using a file handle in a hash. For example:
############################### my %FileHandles; my $Dir = '/tmp'; my $FileName = 'test'; open $FileHandles{$Dir}{$FileName}, "$Dir/$FileName" or die "Cannot op +en $Dir/$FileName: $!"; while (<$FileHandles{$Dir}{$FileName}>) { print $_; } $FileHandles{$Dir}{$FileName}->close; ###############################
The script above doesnt' print the contents in the test file. I only get a line like "GLOB(0xdfa4440)" instead. Any idea?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with using file handle in hash
by GrandFather (Saint) on Jun 24, 2016 at 04:29 UTC | |
by sophate (Beadle) on Jun 24, 2016 at 05:16 UTC | |
|
Re: Problem with using file handle in hash
by BrowserUk (Patriarch) on Jun 24, 2016 at 05:06 UTC | |
by stevieb (Canon) on Jun 24, 2016 at 11:00 UTC | |
by sophate (Beadle) on Jun 24, 2016 at 05:17 UTC |