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

Re: Argument "" Isn't numeric in numeric eq (==)

by RMGir (Prior)
on Feb 09, 2014 at 15:49 UTC ( #1074132=note: print w/replies, xml ) Need Help??


in reply to Argument "" Isn't numeric in numeric eq (==)

You could just disable warnings, but why not say what you intend?

If you want blank entries to be 0, just make them so:

# Consider all blank entries to be 0. foreach (@f) { $_ = 0 unless length $_; }
After that, all your ""'s become zeros, and == will behave just fine.

Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1074132]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2018-07-19 08:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (404 votes). Check out past polls.

    Notices?