I always use parens when calling user-defined subroutines and methods because:
As a matter of style, some folks find the code easier to read when user-defined functions are always called with parens and built-in functions always called without parens. Perl Best Practices endorses this style:
Note that:
use SomeModule (); is equivalent to: require SomeModule;
while:
use SomeModule; is equivalent to: require SomeModule; SomeModule->import();
with use performed at compile time, require at run time. See perlmod for details.
References Added Later
See Also
In reply to Re: New Discovery!!! (sub call without parentheses) - Coding Style
by eyepopslikeamosquito
in thread New Discovery!!! (sub call without parentheses)
by harangzsolt33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |