Paul Johnson wrote:

> On Sun, Apr 04, 2004 at 01:28:42PM -0700, R. Joseph Newton wrote:
>
> > Guay Jean-Sébastien wrote:
> > >
> > > my $errors = 0;
> > > open (CRITICALSERVERS, "$crout") || $errors += 2;
> > >
> > > that will translate to:
> > >
> > > my $errors = 0;
> > > ( open (CRITICALSERVERS, "$crout") || $errors ) += 2;
> >
> > Nope.
>
> $ perl -MO=Deparse,-p -e 'open (CRITICALSERVERS, "$crout") || $errors += 2'
> Can't modify logical or (||) in addition (+) at -e line 1, at EOF
> -e had compilation errors.
> ((open(CRITICALSERVERS, "$crout") || $errors) += 2);

Thanks.  I stand corrected.  I'm afraid I am not very familiar with these
pitfalls, because my coding style doesn't often bring me up against them.
Usually, if I felt a need to consult precedence tables to be sure, I would just
use explicit parentheses.

Joseph


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