Update: As chipmunk indicates, ^ is more akin to | than || (bit-wise versus otherwise) and it does not make sense to use it as a comparison operator. So while xor can still be used, given its low precedence, akin to 'or' in comparisons, it does not have a '^^' counterpart akin to ||, which could be potentially very useful. I'm keeping the rest of this post here for historical purposes.

I don't really share your feelings about 'xor' precedence. Two situations where its precedence allows you to forego parenthesis:

if ($a || $b xor $c || $d) { ... } if ($a xor $b) { ... }
In the first example, would you rather xor's precedence be higher than ||? Now look at what we have to do:
if (($a || $b) xor ($c || $d)) { ... }
If we want to do swap the xor/|| operators, I can possibly see the advantage, but really any complex situation like this is going to almost require you to use paranthesis in order to show Perl how you want things evaluated. Perhaps you are confusing 'xor' with the bitwise/integer xor operator (^), which has a much higher precedence. See perlop.
if ($a ^ $b || $c ^ $d) { ... }
Realistically (and I don't know why I didn't mention this before), this should probably be used in expressions instead of 'xor', unless you need something that's low precedence (like using 'or' or 'and' in expressions).

In reply to Re: Re: Re: Implication operator by Fastolfe
in thread Implication operator by kaatunut

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.