Just another Perl shrine | |
PerlMonks |
Re: to paren or not to parenby kcott (Archbishop) |
on Apr 26, 2014 at 06:01 UTC ( [id://1083896]=note: print w/replies, xml ) | Need Help?? |
G'day quixadhal, When in doubt, you can check how Perl will parse your code fragment from the command line, rather than having to run a (test) script, with this:
See B::Deparse for more information about this. "In most cases, I find I can happily write code which calls functions without needing to use those pesky parenthesis, other than to clarify which arguments are being passed, and which are part of another expression." [my emphasis] Clarification is exactly what's needed here. Perl doesn't know if you meant
or
Notice in the following what's valid and invalid syntax:
For more information about calling methods, see perlobj. In particular, these three sections of that documentation:
-- Ken
In Section
Seekers of Perl Wisdom
|
|