in reply to Re: Constant code
in thread Constant code
The simple answer here is to call sub1() and sub2() with no arguments, use sub1(), etc. Don't use a bare word sub name for a normal user defined sub/function.
And yet, we encourage this all the time in OO paradigms, where we have a member function foo to get the value of 'foo': $obj->foo instead of $obj->foo(), ostensibly because it is a 'value' and the fact that foo is a function is just an implemention detail.
Fooey, I say: if you end up creating a stack entry, use parens. That's just my curmudgeonly USD 0.02.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Constant code
by Anonymous Monk on Jan 20, 2017 at 22:15 UTC | |
|
Re^3: Constant code
by mpersico (Monk) on Jan 20, 2017 at 21:02 UTC | |
by AnomalousMonk (Archbishop) on Jan 20, 2017 at 23:04 UTC |