Sorry I should have said that in the last nested for loop I am *for now* only printing for testing. This is where all the maths will be which is all written in a $list[$a][$b] basis, I'm just printing here for testing. The rest of the code works, It's just that i now need to make it work for a combination of multiple files, rather than on couples of files like I did so far. That's why Dumper \@list isn't suitable.
Basically what I want to know is: is there a way to open those files with two for loops like so
for ($i; $i<=4; $i++) { for ($j; $j<=4; $j++) { #etc while <lines_of_both_$i_and_$j_files> { #etc
This was why I tried to use while <>: extensive googling told me that using @ARGV and the diamond operator was the most efficient way to open multiple files and read them line by line with while. I have a perfectly working script that does all the maths I need but unfortunately it's only doing it for while <$line>. How do I tell perl that I want this done for while <lines_of_both_$i_and_$j_files>? I guess that's what my question boils down to.
I'm sorry I'm really struggling with this, getting really stressed and frustrated that I'm constantly buggering it up and can't even explain properly. I am very grateful for all contributions here and I'm reading and studying all of them, however not understanding everything. Quite disheartening as I've been "coding" on and off for a couple years now so expected to have learnt more
In reply to Re^4: reading files in @ARGV doesn't return expected output
by fasoli
in thread reading files in @ARGV doesn't return expected output
by fasoli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |