in reply to Any differences between method and method()?
For function calls (i.e. non-OO) the parentheses are sometimes necessary. I can never remember the exact formulations - depends very much on whether strict subs are enabled, and on prototypes. For function calls, best to always include the parentheses, unless it's a constant sub, or you are sure that the sub has been defined with an empty prototype.
For method calls on the other hand, if there are no arguments being passed, the parentheses are entirely unnecessary. Use whatever you think looks nicest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Any differences between method and method()?
by AnomalousMonk (Archbishop) on Aug 18, 2012 at 17:41 UTC | |
by tye (Sage) on Aug 18, 2012 at 18:15 UTC | |
by AnomalousMonk (Archbishop) on Aug 18, 2012 at 19:43 UTC | |
by sophate (Beadle) on Aug 19, 2012 at 04:32 UTC | |
by AnomalousMonk (Archbishop) on Aug 19, 2012 at 05:11 UTC | |
by Anonymous Monk on Aug 19, 2012 at 04:38 UTC | |
by tobyink (Canon) on Aug 18, 2012 at 21:13 UTC | |
by AnomalousMonk (Archbishop) on Aug 19, 2012 at 05:18 UTC | |
|
Re^2: Any differences between method and method()?
by hbm (Hermit) on Aug 18, 2012 at 20:11 UTC |