Thanks..... The telling story is ((print(1) and 1) and ('???', '???')); Perl seems to be looking for another operator when using 'and'.
-Jeff --- Paul Johnson <[EMAIL PROTECTED]> wrote: > On Tue, Feb 25, 2003 at 12:21:49PM -0800, Jeff Westman wrote: > > > Basic question on using '&&' vs 'and'. I see that '&&' has higher > precedence > > than 'and', but why does > > > > print 1 && 1 && 0; > > print "\n"; > > print 1 and 1 and 0; > > print "\n"; > > > > return > > 0 > > 1 > > > > I would have expected both statements to return 0. > > s/return/print/g > > > Running your program through perl -MO=Deparse,-p gives: > > print(0); > print("\n"); > ((print(1) and 1) and '???'); > print("\n"); > > "and" has very low precedence. > > -- > Paul Johnson - [EMAIL PROTECTED] > http://www.pjcj.net __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]