http://www.perlmonks.org?node_id=1000039


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.

There are no stupid questions, but there are a lot of inquisitive idiots.