Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by roboticus (Chancellor)
on Mar 31, 2010 at 14:32 UTC ( #832055=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://832055]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2016-06-29 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (379 votes). Check out past polls.