in reply to counter of files? something else?

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 :)