Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: param = 0, not NULL

by Ojosh!ro (Beadle)
on Mar 29, 2007 at 15:41 UTC ( [id://607295]=note: print w/replies, xml ) Need Help??


in reply to param = 0, not NULL


undef, 0 and '' will all cause the default value to be set. The simplest way to check whether your param( 'choice' ) has any or no value is the use of defined

my ( $a, $b, $c ) = ( 0, '', undef ); print defined $a, " -0-\n"; # prints 1 -0- print defined $b, " --\n"; # prints 1 -- print defined $c, " undef"; # prints 0 undef

Hope it helps.

if( exists $aeons{strange} ){ die $death unless ( $death%2 ) }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2026-03-09 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.