in reply to Statement modifier thingie

No, because the statement modifier would then be an expression modifier, not a statement modifier. Think about what exactly is a "statement" in Perl!

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: Statement modifier thingie
by JavaFan (Canon) on Mar 01, 2012 at 11:24 UTC
    Yeah, statements are constructs like:
    if ($foo) {print "Hello"}; package Foo 1.2.3; use Hello; { 1 } next if $bar;
    None of those can receive a "statement modifier".

    In fact, if you inspect perly.y you'll see that expressions are modified:

    sideff : error | expr | expr IF expr | expr UNLESS expr | expr WHILE expr | expr UNTIL iexpr | expr FOR expr | expr WHEN expr ;
    with sideff one of the many forms of statements.

    If you're going to reply with irrelevant snobbery, please aim for the middle of the bowl instead of peeing all over the stall.

    And think what exactly is a "statement" in Perl!

      In fact, if you inspect perly.y you'll see that expressions are modified:
      Interesting! Hence, a statement modifier turns an expression in a statement. Didn't expect this.

      BTW, my comment was not intended as snobbery, but because I concluded that statement modifiers are never part of a sub-expression (as the OP wanted to use them). In any case, your comment is appreciated.

      -- 
      Ronald Fischer <ynnor@mm.st>
Re^2: Statement modifier thingie
by Anonymous Monk on Mar 02, 2012 at 00:33 UTC