Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Open multiple file handles?

by John M. Dlugosz (Monsignor)
on May 07, 2011 at 07:20 UTC ( #903514=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Open multiple file handles?
in thread Open multiple file handles?

How does that follow from your question? You have not shown that you need to open a separate file handle (at the same time) for everything in ARGV. We have pointed out that the diamond operator opens each one in turn, automatically. From the problem you presented, there is no reason to open the files all at the same time, and even if you did so, what would you do with them all?

But a direct answer to that question is: call open for each one. What's the big deal? Call open in a loop, or get fancier with a map statement.

Do you realize that you can use a variable as the file handle, rather than an old-fashioned GLOB thing? Maybe that's the part you are missing. I hesitate to show a complete example because you should not need to do that at all.


Comment on Re^3: Open multiple file handles?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-10-31 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (222 votes), past polls