Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: chaining de...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 5 Topic 11032 of 11401
Post > Topic >>

Re: chaining defines

by Peter@[EMAIL PROTECTED] (Peter Scott) May 7, 2008 at 04:38 AM

On Tue, 06 May 2008 18:04:00 +0200, Jenda Krynicky wrote:
> From: Robert Hicks <sigzero@[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 -e "defined $one && defined $two && $one eq 
> $two"
> $one eq $two if defined $one and defined $two;
> -e syntax OK

A bit more explicitly (and interestingly different):

$ perl -MO=Deparse,-p -e 'defined $one && defined $two && $one eq $two'
((defined($one) and defined($two)) and ($one eq $two));
-e syntax OK

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
 




 5 Posts in Topic:
chaining defines
sigzero@[EMAIL PROTECTED]  2008-05-06 09:49:29 
Re: chaining defines
yitzle@[EMAIL PROTECTED]   2008-05-06 10:43:15 
Re: chaining defines
Jenda@[EMAIL PROTECTED]   2008-05-06 18:04:00 
Re: chaining defines
sigzero@[EMAIL PROTECTED]  2008-05-06 12:27:58 
Re: chaining defines
Peter@[EMAIL PROTECTED]   2008-05-07 04:38:06 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 7:02:52 CDT 2008.