Thank you so much, soonix!

This worked:

before the foreach loop: my $file_number = 0;

in the loop: $file_number += 1;

Now all I need to do is understand why it worked (reading, homework) and then wonder why I never thought about it if it was a matter of 2 lines (more reading, more homework).

As a general comment on my short Perl experience, I found it quite easy to stop making syntax errors and quite easy to begin to understand what's happening. For example I had a much worse time when attempting to learn some Python, I found it too complex. Perl seems a bit "easier" and I like the regex. Although for a chemist (me) it all is a bit confusing. Been coding on and off for about 4 months now and not very happy with my progress, I hope that the books will help.

Thank you all so so much, I appreciate your help and suggestions A LOT :)

Off to more homework :)


In reply to Re: counter of files? something else? by fasoli
in thread counter of files? something else? 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.