Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: if not defined

by Eimi Metamorphoumai (Deacon)
on Mar 23, 2007 at 18:15 UTC ( #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
Node Status?
node history
Node Type: note [id://606317]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2020-10-20 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (209 votes). Check out past polls.

    Notices?