in reply to How to avoid eval()?
This takes a piece of string and executes it as Perl code. This is the bad kind.
This is Perl's equivalent for try/catch in other languages, and there's nothing wrong with it.
update Duh! You're talking about executing user supplied code, so of course it's eval STRING.
Well, there's no way to avoid executing user supplied code if you want to execute user supplied code.
Either you eval the input as Perl, or you provide a small language (not Perl) and interpret it, in Perl. The latter is safer, but a lot of work to implement.
|
|---|