OT - Perl Question

Fernando Gleiser fgleiser at cactus.fi.uba.ar
Tue Nov 11 13:00:37 PST 2003


On Tue, 11 Nov 2003, Darryl Hoar wrote:

>
> if ( $nation eq "British"  or  $nation eq "New Zealand" )
> {
>  print "Hallo $name, pleased to meet you!\n";
>
> }
>
> when I try to run it, it generates a compile errors on the
> if line.
>
> I know its the conditional test, but don't know how to fix
> it to be syntactically correct in perl.

Precedence errors, change it to:

if ( ($nation eq "British")  ||  ($nation eq "New Zealand") )

When in doubt, parentesize defensivelly :)

Hope this helps.


		Fer

>
> Any help?
>
> thanks,
> -D
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>



More information about the freebsd-questions mailing list