Is it possible to do something like this? I'd like to use eval to generate a bunch of function pointers during runtime and I'd like to be able to pass in and retrieve parameters.
Thanks!
my $a = 'return $_[0] + $_[1];'; print eval $a(3, 5); or perhaps: my $a = 'return $_[0] + $_[1];'; print eval $a->(3, 5);
In reply to eval code generation - parameters & return values by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |