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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.