http://www.perlmonks.org?node_id=130963


in reply to Mileage with safe

Are you just trying to make sure that errors in the plugin don't cause your code to die? Which eval is great for. Or are you trying to restrict the plugin to only be able to perform a (very) limited amount of actions? Which Safe.pm should be great for.

If all you're trying to do is keep the plugin's errors from aborting your code, but still want it to be able to do anything that the rest of the codebase does, then eval is probably the best choice. Just log $@ after the eval so the plugin authors have a way of tracking down their errors.