Do you know where your variables are? | |
PerlMonks |
Re: Re: I'm confused with Bitwise Operatorsby mephit (Scribe) |
on Jun 07, 2002 at 21:51 UTC ( [id://172684]=note: print w/replies, xml ) | Need Help?? |
Something else to consider: "distribution" (or lack thereof) of the binding operator. Note that
$_ =~ (/A/ && /B/) is not equivalent to
($_ =~ /A/) && ($_ =~ /B/).
The latter is what you would want.
Regarding the original poster's code: This works only because $_ is being tested. Taking precedence into consideration (and the fact that m// works on $_ by default), this code is equivalent to If the data were in any other variable ($var, for example), and one just replaced $_ with $var in the OP's code, it would be equivalent to which isn't What You Want. Just my observations. HTH. -- There are 10 kinds of people -- those that understand binary, and those that don't.
In Section
Seekers of Perl Wisdom
|
|