in reply to New Discovery!!! (sub call without parentheses)
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: New Discovery!!! (sub call without parentheses)
by stevieb (Canon) on Dec 08, 2018 at 23:00 UTC | |
by LanX (Saint) on Dec 09, 2018 at 00:28 UTC | |
Re^2: New Discovery!!! (sub call without parentheses)
by LanX (Saint) on Dec 08, 2018 at 19:25 UTC |