Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: store file handles in a hash

by Athanasius (Abbot)
on Oct 30, 2012 at 14:14 UTC ( #1001510=note: print w/ replies, xml ) Need Help??


in reply to store file handles in a hash

From print:

If you're storing handles in an array or hash, or in general whenever you're using any expression more complex than a bareword handle or a plain, unsubscripted scalar variable to retrieve it, you will have to use a block returning the filehandle value instead...

So, just change the last line in the while loop to:

say { $handles{$file_out} } join "\t", @some_data;

Hope that helps,

Athanasius <°(((><contra mundum


Comment on Re: store file handles in a hash
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001510]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2015-07-04 16:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls