All of the following satisfy your criteria, are valid and normal Perl code, and would get a semicolon incorrectly inserted based on your criteria:
use softsemicolon;

$x = $a
   + $b;

$x = 1
    if $condition;

$x = 1 unless  $condition1
           && $condition2;

Yes in cases 1 and 2; In case 3 if the scanner always returns previous token (one token lookahead) this will be detected (no Perl statement can start with && )

As for "valid and normal" your millage may vary. For people who would want to use this pragma it is definitely not "valid and normal". Both 1 and 2 looks to me like frivolities without any useful meaning or justification. Moreover, case 1 can be rewritten as:

$x =($a + $b);
The case 3 actually happens in Perl most often with regular if and here the opening bracket is obligatory:
if ( ( $str=~/a\[s\]/ || $str =~/h\[s\]/ ) && ( $str... ) ){ .... }
Also Python-inspired fascination with eliminating all brackets does not do here any good
1 2 $a=$b=1; 3 $x=1 if $a==1 4 && $b=2;
should generally be written
2 $a=$b=1; 3 $x=1 if( $a==1 4 && $b=2);
I was surprised that the case without brackets was accepted by the syntax analyser. Because how would you interpret the statement $x=1 if $a{$b++}; without brackets is unclear to me. It has dual meaning: should be a syntax error in one case
$x=1 if $a{ $b++ };
and the test for an element of hash $a in another.

In reply to Re^12: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff by likbez
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff by likbez

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.