plain and simple. I'm surprised none of the other, many replies suggested as much.$coderef = eval "sub { $code }";
Check the return value of the eval and/or $@, if the eval fails and returns undef, you must have had a syntax error.
In reply to Re: Dynamically Creating a Code reference
by bart
in thread Dynamically Creating a Code reference
by Herkum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |