in reply to How to open file inside loops with file names generated using an array?
Note the angle brackets around the filename, they should help you find potential whitespace. The most common mistake is a missing chomp.for my $dat1 (@data1) { for my $dat2 (@data2) { my $filename = "file_$dat1\_$dat2.txt"; print "<$filename>\n"; open my $fh, '<', $filename or die "a horrible death $!"; } }
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to open file inside loops with file names generated using an array?
by skooma (Novice) on May 28, 2018 at 08:20 UTC | |
by roboticus (Chancellor) on May 28, 2018 at 12:50 UTC |