Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Undefined vs empty string

by Cristoforo (Curate)
on Jun 05, 2013 at 02:34 UTC ( #1037093=note: print w/replies, xml ) Need Help??


in reply to Undefined vs empty string

I think you could just write if (!$string) if you were sure $string couldn't be 0 or '0'. (a zero or zero in quotes)

Not sure if that answers your question.

Update: Just saw that Athanasius and BrowserUk posted similar answers.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (None)
    As of 2017-07-27 00:59 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      I came, I saw, I ...
























      Results (402 votes). Check out past polls.