On Thursday 15 April 2004 11:22, Jayakumar Rajagopal wrote:
>
> $a=100; $b=200;
> ($a=3 && $b=6 ) if ( 1 == 1 );
> print " $a   $b  \n";
>
> Output : 6   6
>
> OR my syntax is wrong ?

You have a precedence problem.  Your expression evaluates as:

$ perl -MO=Deparse,-p -e'($a=3 && $b=6 ) if ( 1 == 1 );'

($a = ($b = 6));

-e syntax OK

You need to either add parentheses or use the lower precedence 'and' 
operator:

( ($a = 3) && ($b = 6) ) if ( 1 == 1 );

Or:

( $a = 3 and $b = 6 ) if ( 1 == 1 );



John
-- 
use Perl;
program
fulfillment


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to