Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Anyone use "xor" in conditionals?by BrowserUk (Patriarch) |
on Jul 14, 2003 at 02:06 UTC ( [id://273861]=note: print w/replies, xml ) | Need Help?? |
It has its uses. The conventional way of determining if a year is leapyear goes something like this code from Date::Leapyear
This can also be written as
Proof :)
You should probably also seach for '^', but as I discovered, this is a sight more complex isolate the xor uses from all the other uses perl makes of this character. Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
In Section
Seekers of Perl Wisdom
|
|