in reply to Dynamically Creating a Code reference
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dynamically Creating a Code reference
by Herkum (Parson) on Jun 16, 2006 at 12:38 UTC | |
by bart (Canon) on Jun 16, 2006 at 13:07 UTC | |
by Herkum (Parson) on Jun 16, 2006 at 13:34 UTC |