in reply to Re: How to call a sub-routine ref
in thread How to call a sub-routine ref

And if you don't have an argument to pass, isn't it weird to have empty parenthesis?

$hashref->{'key'}->();

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

Replies are listed 'Best First'.
Re^3: How to call a sub-routine ref
by ikegami (Patriarch) on Oct 19, 2012 at 21:55 UTC
    Why would it be weird? Parens around the arg list, even an empty args list, is the normal way of calling a sub. Omitting parens leads to many problems.
Re^3: How to call a sub-routine ref
by roboticus (Chancellor) on Oct 19, 2012 at 20:36 UTC

    greengaroo:

    As a long-time C/C++/C# coder, I don't find the empty parenthesis weird. (Though it took me a (very) little while getting used to leaving off parenthesis altogether.)

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.