From: Steve Hancock Date: Wed, 30 Sep 2020 23:27:22 +0000 (-0700) Subject: added example to docs X-Git-Tag: 20201001.01~35 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9a269cdf6e214d9eb2d08c2068c0b179a91f24ee;p=perltidy.git added example to docs --- diff --git a/bin/perltidy b/bin/perltidy index b1b7d890..45926b67 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -1179,6 +1179,20 @@ But the following will give a syntax error: # perltidy -nwrs='-' my @newkeys = map $_ -$nrecs + @data, @oldkeys; +For another example, the following two lines will be parsed without syntax error: + + # original programming, syntax ok + for my $severity ( reverse $SEVERITY_LOWEST+1 .. $SEVERITY_HIGHEST ) { ... } + + # perltidy default, syntax ok + for my $severity ( reverse $SEVERITY_LOWEST + 1 .. $SEVERITY_HIGHEST ) { ... } + +But the following will give a syntax error: + + # perltidy -nwrs='+', syntax error: + for my $severity ( reverse $SEVERITY_LOWEST +1 .. $SEVERITY_HIGHEST ) { ... } + +As a general rule, it seems best to keep whitespace balanced around binary operators. =item Space between specific keywords and opening paren