October 2006
Beginner
504 pages
12h 58m
English
In this book, we’ve discussed several situations that require the use of parentheses around code. For easy reference, we provide here a complete summary of the cases that come up most frequently in Minimal Perl.
To demonstrate the benefit of adding your own parentheses, the parentheses you effectively get by default are shown in the comments adjoining the code samples.
You should use parentheses:
Around a function’s arguments, to exclude following elements from that argument list:
print sort (@F), '!'; # Default: print sort (@F, '!');
Around any multi-element argument list for our or chomp:
chomp ($X, $Y); # Default: chomp ($X), $Y; our ($X, $Y); # Default: our ($X), $Y;
Anywhere the higher precedence of ...