http://www.perlmonks.org?node_id=832055


in reply to "Use of uninitialized value" due to empty elements in an array

michaelp:

If you simply want to turn undefined elements into an empty string, you could add a step to perform the conversion immediately after the split, like so:

@line_split = map { defined($_) ? $_ : '' } split (/\t/, $line);

...roboticus

  • Comment on Re: "Use of uninitialized value" due to empty elements in an array
  • Download Code