&& or and both work
perldoc perlop
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 30, 2003 8:55 AM
> To: [EMAIL PROTECTED]
> Subject: What is the and operator in perl
>
>
> If I want to do something like
>
> if ($a=$b) and ($
From: [EMAIL PROTECTED]
> If I want to do something like
>
> if ($a=$b) and ($d=$e)
> Is it possible?
>
> because & is for bitwise AND operation.
if ($a==$b and $d==$e)
or
if (($a==$b) && ($d==$e))
Please note that I'm using ==.
== is numerical
you can use "and" or "&&".
if (($a==$b) && ($d==$e)) {
# code here
}
and has a lower precedence than &&.
For or there's "or" or "||"
HTH
Nigel
MIS Web Design
http://www.miswebdesign.com/
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 30 Janu