Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Is it possible to use a scalar to call a subroutine?by bradcathey (Prior) |
on May 06, 2010 at 16:45 UTC ( [id://838749]=perlquestion: print w/replies, xml ) | Need Help?? |
bradcathey has asked for the wisdom of the Perl Monks concerning the following question: Fellow Monasterians, I've searched the "Internets" and the library here in the monastery, but can't find anything definitive. Read lots of stuff about dispatch tables and anonymous subs, and tried several approaches but epic fails. Here's what I'm trying to do. Thoughts? TIA.
UPDATE: I start getting nervous making exceptions to strict to make things work below, but more importantly, to kennethk's point (below) I might want to rethink why I'm using a variable for a variable name. I had tried to do this many years ago for simple scalars, but got a lesson from one of the senior monks at the time about using hashes, and it changed everything. So, a simple conditional statement or dispatch table might be a better practice.
—Brad "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Back to
Seekers of Perl Wisdom
|
|