in reply to Re: How to call a sub-routine ref
in thread How to call a sub-routine ref
Yes I know. Here is another example with an anonymous subroutine:
my $ref = sub { print "Hello World!\n"; }; # Both are equivalent $ref->(); &{$ref}(); # But which one is best? That is the question!
Also, I don't do simple stuff like that, I have objects and callback functions and so on. Most of the time I have deep structures that returns functions, or objects, then I want to call that function or object method.
Let me sleep on it and I will try to provide a more concrete example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to call a sub-routine ref
by blue_cowdawg (Monsignor) on Oct 22, 2012 at 12:47 UTC | |
by greengaroo (Hermit) on Oct 22, 2012 at 14:27 UTC |