Hi Sastry -
  
At 2005-11-15, 00:25:37 you wrote:
>Hi
>I have a script that gives error
>
>"Syntax error at /u/isldev3/exp/oper.pl line 7, near ")
>  print"
>Execution of /u/isldev3/exp/oper.pl aborted due to compilation errors."
>
>$x =3D 3;
>$y =3D 4;
>$z =3D 3;
>
>if  (($x & $y & $z) < 20)
>  print "\n Lies below the range";

You need {} in if:

if  (($x & $y & $z) < 20) {
  print "\n Lies below the range";
}

Or you can use the handy perl 'post-if' construct:

print "\n Lies below the range" if  ($x & $y & $z) < 20;

>
>a) Is it supposed to give error?
>b)If so why is the language construct so different compared to any
>structured language like C?

Because it's better! :)
Don't fight it - learn perl and you will be happy.

>
>regards
>Sastry
>
                        
Aloha => Beau;
[EMAIL PROTECTED]
2005-11-15



-- 
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