Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How to open file inside loops with file names generated using an array?

by Athanasius (Archbishop)
on May 28, 2018 at 07:35 UTC ( [id://1215291]=note: print w/replies, xml ) Need Help??


in reply to How to open file inside loops with file names generated using an array?

Hello skooma,

choroba got in ahead of me, but another possibility is that your nested loops are generating more filenames than you actually have files. In the example given, your array @data1 will contain 1.1 and 1.2, and the array @data2 will contain 2.1 and 2.2. But your nested loops will then generate four file names:

file_1.1_2.1.txt file_1.1_2.2.txt file_1.2_2.1.txt file_1.2_2.2.txt

Do all of these files exist in the folder? If not, that would explain the “No such file” errors.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-20 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found