in reply to Re^3: How to amend character count.
in thread How to amend character count.

I am just commending to avoid confusion, OP on the open function has write mode > instead of read mode <.
Because the OP opens this file with the intent of writing data to it, as shown in this code line:
print $fh $count;
So there is really nothing wrong with that.

The OP code is reading from a file (passed as an argument to the program) and writing to another, opened explicitly with the open command.

Replies are listed 'Best First'.
Re^5: How to amend character count.
by thanos1983 (Parson) on May 07, 2017 at 18:26 UTC

    Hello Laurent_R,

    You are absolutely right. I was not aware of the (Variables related to filehandles):

    $ARGV Contains the name of the current file when reading from <> .

    Thanks again for clarification.

    Seeking for Perl wisdom...on the process of learning...not there...yet!