Hello,
I got a warning message "Found = in conditional, should be" after executing that code:
perl -wle 'my $has_even; @_ = -1 .. 9; for( @_ ){ print $_; $_ % 2 or +$has_even = 1 and last } print "\$has_even:[$has_even]"; '
OUTPUT:
Found = in conditional, should be == at -e line 1. -1 0 $has_even:[1]
Here '=' is intentional, so a warning is obsolete.
I think it is useful warning message to catch mistype. But in perlop operators 'and' and 'or' are not named being conditional. It is explained in other words (e.g. for 'and'): "the right expression is evaluated only if the left expression is true". In perlop document there is a section named "Conditional Operator", which is about ternary conditional operator. But it seems that it is not the only one conditional operator. So for clarity this section could be renamed to "ternary conditional operator". And also it could be added "a conditional operator" within description of 'and' and 'or'. Also a conditioness attribute could be shown in a widened attribute table (idea proposed in earlier node: For discussion: operator attributes - associativity, chainity and ability to short-circuit).

Back to a warning message. In my code instead of "$has_even = 1" it could be '$has_even = "TRUE"'. In that case a warning would seem even more obsolete because "TRUE" is not number-like.

In reply to Situation where warning "Found = in conditional, should be" seems obsolete by rsFalse

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.