Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by chuckbutler (Prior)
on Mar 31, 2010 at 14:14 UTC ( #832053=note: print w/replies, xml ) Need Help??


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

The defined function is what you need. It returns true if the value being tested IS NOT the special undef value. So something like:

unless (defined($line_split[0])) {...} ...

ahead of your other tests should get the job done.

Update: Fixed typo..

Good luck. -c

  • 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://832053]
help
Chatterbox?
[Discipulus]: somene can explain me Anonymous's irony?

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-11-21 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (297 votes). Check out past polls.

    Notices?