Variable variable name

Mark Hartley mark at drapple.com
Wed Jul 3 19:26:06 CDT 2002


On Wed, Jul 03, 2002 at 04:14:31PM -0700, Jason White wrote:
> Here is some code.
> 
> my $functionToCall = "foo";
> 
> ???????( )
> 
> sub foo(){
>  
>  print "FOO!\n";
> 
> }
> 
> 
> How can I use the variable $functionToCall to replace ???????  with foo( ) ?
> 
> Jason White 


&$functionToCall();

(page 254 of Camel book - revision 2)   :-)



Mark.
TIMTOWTDI



More information about the Pdx-pm-list mailing list