Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^5: What is true and false in Perl? (undef,undef)

by davido (Archbishop)
on Nov 22, 2013 at 18:11 UTC ( #1063973=note: print w/replies, xml ) Need Help??


in reply to Re^4: What is true and false in Perl? (undef,undef)
in thread What is true and false in Perl?

What do you think ref does?

In your example code, $a doesn't contain a reference. It contains a false value. ref does exactly this: "Returns a non-empty string if EXPR is a reference, the empty string otherwise."


Dave

Replies are listed 'Best First'.
Re^6: What is true and false in Perl? (undef,undef)
by amartyaj (Initiate) on Nov 22, 2013 at 19:35 UTC
    Got it. Thanks a lot Dave.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063973]
help
Chatterbox?
[Corion]: Hmm - the longer I work, the more such sentences I collect:
[Corion]: "If I wanted to work with people, I would have become a coroner."
[Corion]: "If I wanted to work with hot air, I would have become a baloonist"
[Corion]: "If I wanted to work with flaps, I would have become a mailman"
[Corion]: (I'm not sure if the last one works in English too ;) )

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-09-21 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (248 votes). Check out past polls.

    Notices?