You could use symbolic code references in place of your eval sting (in blocks where you turn off strict refs). Unfortunately, that doesn't really solve your issue and still results in more code. It does bookend your statements and should be clearer for maintenance. You could also just create a code ref for your run routine and then pass it arguments later to decouple, a la
my $code; my $sub_ref = 'sample'; #my $sub_ref = "Lua::$module::$funcname"; { no strict 'refs'; $code = \&{"sample"}; } my @args = (1,2,3); print $code->(@args); sub sample { return shift @_; }
In reply to Re: Inline::* and string eval -- Have I found a place where it might actually be necessary?
by kennethk
in thread Inline::* and string eval -- Have I found a place where it might actually be necessary?
by Luftkissenboot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |