in reply to Implied operators are maddening

I don't think this is a problem with Perl's operators. The Perl interpreter (5.8 at least) gets this syntax right:
$a = 'mmm'; $b = 'yyy'; if ( ( $a =~ /m/i ) && ( $b =~ /y/i ) ) { print "Hello\n"; } if ( ( $a =~ m/m/i ) && ( $b =~ m/y/i ) ) { print "Hello\n"; } __OUTPUT__ $ perl test.pl Hello Hello $ perl -MO=Deparse test.pl $a = 'mmm'; $b = 'yyy'; if ($a =~ /m/i and $b =~ /y/i) { print "Hello\n"; } if ($a =~ /m/i and $b =~ /y/i) { print "Hello\n"; }
I wonder what P::RD could be doing with the code you give it to cause this. I'm not very familiar with the module, but that's just odd. Bug?

FWIW, the regexes match correctly when I wrap them both in eval q{}'s. So eval doesn't seem to be a problem either.

blokhead

Replies are listed 'Best First'.
Re: Re: Implied operators are maddening
by jepri (Parson) on Jun 04, 2003 at 06:15 UTC
    Yep, this is basically what people told me before I posted my update.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.