in reply to 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.
Perhaps you could fill in the blanks?
Unless you have pre-populated the object hash with a key matching every possible return value from every possible test name, and associated an appropriate coderef for all of those keys; that line isn't trying to do what you think it is. (And even if it is, the way it is written is unnecessarily complicated and obfuscate.)
(And a brief glance at the rest of your code makes me think you're writing code you will not be able to maintain.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to call a sub via variable in library
by Anonymous Monk on Nov 17, 2014 at 19:33 UTC | |
by BrowserUk (Patriarch) on Nov 17, 2014 at 19:46 UTC | |
|
Re^2: how to call a sub via variable in library
by glenn (Scribe) on Nov 17, 2014 at 21:18 UTC | |
by BrowserUk (Patriarch) on Nov 17, 2014 at 22:04 UTC |