Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: if not defined

by pKai (Priest)
on Mar 23, 2007 at 19:11 UTC ( #606329=note: print w/replies, xml ) Need Help??

in reply to Re: if not defined
in thread if not defined

I'd say the former (resembeling the OP) makes sense:

It's testing for all vars at first if it is defined and then if it also isn't the empty string. This partial results is inverted for $odate and then chained on the same level. The result of that is inverted by the leading "not".

If you ignore the (possible) warnings, when a string function is applied to undef

!(length($pname) && length($policy_ur) && !length($odate))
will yield the same.

That may be what he wants or not.

Your (!defined($pname) && $pname ne '') on the other hand is only true für $pname being "undef", so contains a redundant test.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2021-04-11 19:46 GMT
Find Nodes?
    Voting Booth?

    No recent polls found