Re: Function alias
- From: Jürgen Exner <jurgenex@xxxxxxxxxxx>
- Date: Tue, 07 Apr 2009 04:41:12 -0700
neilsolent <n@xxxxxxxxxxxxxxxxxxxxxx> wrote:
How can I call the subroutine that is named in a scalar variable
$func?
Here, the scalar $func will contain either "Test1" or "Test2"
One quick and dirty way: use eval(), which of course comes with its own
load of risks and issues.
The best way is to use a dispatch table, see DejaNews aka Google Groups
for details, this has been discussed before.
jue
.
- References:
- Function alias
- From: neilsolent
- Function alias
- Prev by Date: Re: Function alias
- Next by Date: Re: Function alias
- Previous by thread: Function alias
- Next by thread: Re: Function alias
- Index(es):
Relevant Pages
|