Re: chaining defines

2008-05-07 Thread Peter Scott
On Tue, 06 May 2008 18:04:00 +0200, Jenda Krynicky wrote: > From: Robert Hicks <[EMAIL PROTECTED]> >> Is there anything wrong with: >> >> if ( defined $one && defined $two && $one eq $two ) { >> do something >> } > > As far as I can tell not. I was afraid the operator precedence might >

Re: chaining defines

2008-05-06 Thread Robert Hicks
Jenda Krynicky wrote: From: Robert Hicks <[EMAIL PROTECTED]> Is there anything wrong with: if ( defined $one && defined $two && $one eq $two ) { do something } As far as I can tell not. I was afraid the operator precedence might play tricks with it, but looks like it doesn't: V:\>

Re: chaining defines

2008-05-06 Thread Jenda Krynicky
From: Robert Hicks <[EMAIL PROTECTED]> > Is there anything wrong with: > > if ( defined $one && defined $two && $one eq $two ) { > do something > } As far as I can tell not. I was afraid the operator precedence might play tricks with it, but looks like it doesn't: V:\>perl -MO=Deparse

Re: chaining defines

2008-05-06 Thread yitzle
On Tue, May 6, 2008 at 9:49 AM, Robert Hicks <[EMAIL PROTECTED]> wrote: > Is there anything wrong with: > > if ( defined $one && defined $two && $one eq $two ) { > do something > } No. Its fine. You might be interested in "Operator Precedence and Associativity" [1] [1] http://perldoc.pe