$x will evaluate to false if it is 0 or evaluates to 0, if it is an empty
string, or if it is undef. So for the most part if $x has anything in it,
it will evaluate to true.
The code below says, "If $x has anything in it, then call warn with $x as a
parameter".
Personally, I usually go out of my way to write it like this to avoid
confusion:
if($x){
warn $x;
}
-----Original Message-----
From: Dermot Paikkos [mailto:[EMAIL PROTECTED]
Sent: Monday, July 07, 2003 8:48 AM
To: [EMAIL PROTECTED]
Subject: Warn if ?
Hi Gurus,
I have seen the following in example scripts but do not full
understand it.
"warn $x if $x"
I understand what warn does but I don't understand what it is
evaluating? Can someone explain.
Thanx.
Dp.
~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]