P is for Practical | |
PerlMonks |
Re^3: call external sub ref from method in single line (some golf)by mr_ron (Chaplain) |
on Oct 05, 2015 at 15:57 UTC ( [id://1143831]=note: print w/replies, xml ) | Need Help?? |
Some golf code can have the advantage of clarifying the question by being read quickly. It may be more for quick examples because in production code spelling things out more may make for easier debugging and modification. It later occurred to me that you don't always need a subroutine reference to call outside an object or package although it could be useful. If the call is not object dependent you can just specify the name of the other package like "main::hello()". I included my simplified/golfed example below:
Ron
In Section
Seekers of Perl Wisdom
|
|