![]() |
|
Syntactic Confectionery Delight | |
PerlMonks |
Re: New Discovery!!! (sub call without parentheses) - Coding Styleby eyepopslikeamosquito (Archbishop) |
on Dec 08, 2018 at 17:46 UTC ( [id://1226973]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|