Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Check For null Arguments

by nvivek (Vicar)
on Mar 14, 2013 at 04:52 UTC ( #1023368=note: print w/ replies, xml ) Need Help??


in reply to Check For null Arguments

A better way to check for particular value is defined or not, use defined function in perl.

Syntax: defined EXPR

defined function will return true if EXPR has a value other than the undefined value "undef".
Defined function will return true even if the value of particular scalar is null string. To check whether value of scalar is defined and not null, use following code.

my $defined_string="Defined_value"; print "Value of defined_string is defined and its value:$defined_strin +g" if(defined $defined_string && $defined_string ne '');


Comment on Re: Check For null Arguments
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-08-28 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls