What is called post-for / if syntax?

Does the following syntax have a name?

print for ( @ARGV );

exit if $x;
+5
source share
4 answers
+7
source

He called "sentence modifiers" in the perlsyn documentation .

+4
source
+1

, , .

, :

pre-condition/prefix construct:

... ( $ x) (pre) ({... exit...;})

( ) .

for ( @ARGV ){
    print;
}

if ($x) {
    exit;
}

-/ :

... ( $ x) (post) ({... exit...;})

This is the opposite. Mostly for shortcuts or single line. Some find this useful, but it is usually discouraging because of readability and understanding: see @Mob answer
Or from PerlMonks: https://www.perlmonks.org/?node_id=177971

print for ( @ARGV );

exit if $x;
0
source

All Articles