in reply to Re: Why is there only one column in the output file?
in thread Why is there only one column in the output file?

you probably want something like this

while(<IN>){
    my $line = $_;

No.    Nobody wants something like that.

Why store the same value in two different variables when you only use one variable inside the loop.

Perhaps you meant:

while ( my $line = <IN> ) {

Replies are listed 'Best First'.
Re^3: Why is there only one column in the output file?
by ryber (Acolyte) on Apr 06, 2012 at 14:13 UTC

    jwkrahn, you miss the point.

    The main point was to check for and weed out blank lines and those which do not contain enough fields. I agree it would be better to assign the $line var in the while statement as well; I wrote it that way to change the OP's code as little as possible and focus on the input validation pieces.