in reply to Strange File read problem

Try changing the last line of the program to

foreach my $str (@lines){print $str, "\n"};

I'm guessing that all the lines are being printed one over the other on the terminal?


Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

Replies are listed 'Best First'.
Re (2): Strange File read problem
by VSarkiss (Monsignor) on Apr 09, 2003 at 15:24 UTC

    Possible, but doubtful. He's not using chomp or removing the newline in any other way, so the \n should still be there....

    That said, I don't know what the problem is either.