in reply to Re: how to call a sub via variable in library
in thread how to call a sub via variable in library

I've been staring at this unholy construct $self->{&{\&{$testname}}}->($system); for about 15 minutes, And I still haven't a clue what it's meant to do.
This is a very obscure and useless feature of Perl. Documented in strict
$bar = \&{'foo'}; &$bar;
is allowed so that "goto &$AUTOLOAD" would not break under stricture.

Replies are listed 'Best First'.
Re^3: how to call a sub via variable in library
by BrowserUk (Patriarch) on Nov 17, 2014 at 19:46 UTC

    That bit is obfuscated, but at least understandable.

    It's the invoking of a subroutine from the object hash keyed by the return code of that subroutine that I find completely unlikely.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.