On execution, it prints "onetwo" while I expected it to run only $hash{1}? What am i doing wrong?perl -e '$choice='1'; %hash=( '0' => &one, '1' => &two ); ${\$hash{$ch +oice}}; sub one {print "one"}; sub two {print "two"}'
In reply to execute function with name passed as string parameter by rgcosma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |