in reply to "Use of uninitialized value" due to empty elements in an array
Tell split not to remove empty trailing fields.
And if you want, you can check if you got enough fieldsmy @line_split = split(/\t/, $line, -1);
if (@line_split != 3) { die("Not enough fields in line $.\n"); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: "Use of uninitialized value" due to empty elements in an array
by michaelp (Initiate) on Mar 31, 2010 at 17:28 UTC |
In Section
Seekers of Perl Wisdom