While Devel::Pointers technically accomplished what I was looking to do, the use of do() instead of require() proved to be a much better solution. Further, it addresses the concerns expressed by 'pg'.
my $rc = do($mycode); if ($@ || !defined($rc)) { if ($@) { if (ref($@) eq 'HASH') { print("Error from $mycode: $$@{'Error'}\n"); } else { print("Compilation errors in $mycode: $@"); } } else { print("Couldn't access $mycode: $!"; } }
In reply to Re: Re: Extracting a hash reference from a string
by Anonymous Monk
in thread Extracting a hash reference from a string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |