Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Open multiple file handles?

by John M. Dlugosz (Monsignor)
on May 07, 2011 at 07:20 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found