in reply to Re^2: How to process several files with different line numbers
in thread How to process several files with different line numbers

...unless I do not understand what you mean with write.

The line in question is:

print READ "is empty!\n";

This syntax has the form print FILEHANDLE LIST, as documented in print, and it says: print the string “is empty!”, followed by a newline, to the filehandle READ. But, as I pointed out, the READ filehandle has been opened for reading (input), not writing (output). The only reason you are not seeing this die is that the files you are testing aren’t empty, so the condition never evaluates to true and the print statement is never actually called.

You probably meant to write just print "is empty!\n"; which is equivalent to print STDOUT "is empty!\n";, but you should also consider using warn "is empty!"; which is equivalent to print STDERR "is empty!\n"; (see warn).

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^4: How to process several files with different line numbers
by thanos1983 (Parson) on Jul 05, 2014 at 23:05 UTC

    Hello Athanasius,

    Oh my mistake you are absolutely right, I do not notice that believe it or not. I was thinking something completely different, because I copied this part of another script that I used and I had in my mind by READ the name of the file.

    Thanks for pointing out, I should modify it now. :D

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