Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: if not defined

by Eimi Metamorphoumai (Deacon)
on Mar 23, 2007 at 18:15 UTC ( [id://606317]=note: print w/replies, xml ) Need Help??


in reply to if not defined

not defined is fine, but not is very low precedence. That is,
if (not defined($pname) && $pname ne ''){
is parsed the same as
if (not (defined($pname) && $pname ne '')){
instead of
if ((not defined($pname)) && $pname ne ''){

Also, if $pname isn't defined, then it can't possibly equal '', so you probably need to change your conditions a bit (probably you mean something like

if (!defined($pname) || $pname eq ''){
but it's possible you want something else.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-24 04:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found