in reply to Array element getting deleted

Sometimes/often the use strict/use warnings stuff actually helps you in understanding what goes wrong. Hint:

readline() on closed filehandle READ
Use of uninitialized value in join or string

Replies are listed 'Best First'.
Re^2: Array element getting deleted
by ww (Archbishop) on Apr 17, 2009 at 12:33 UTC
    /methinks your messages reflect the absence of a file named "text.txt" rather than anything that would be resolved by use of strict or warnings. Adding those and running perl -c pl_test/758183.pl returns syntax OK.

    OTOH, checking the open:

    open(READ, "< test.txt") || die "Cannot open text.txt. $!";

    produces this:

    Cannot open text.txt. No such file or directory at pl_test/758183.pl line 18.