Hi Tom, This is because of operator precedence, && is higher then =. What you are effectively saying is
@f = (`cat nonExistentFile` && 1==1) when you probably want (@f = `cat nonExistentFile`) && 1==1 The code you have ends up assigning to @f an array with a single element, the empty string. This then evaluates to true in the conditional statement. -Jason On 1/28/07, tom arnall <[EMAIL PROTECTED]> wrote:
the following script: if (@f = `cat nonExistentFile` ) { print 1; } if (@f = `cat nonExistentFile` && (1==1)) { print 2; } gets: cat: nonExistentFile: No such file or directory cat: nonExistentFile: No such file or directory 2 seems to me both print statements should be skipped. what am i missing? tom arnall north spit, ca "Relax, the tests extend the compiler." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/