in reply to Template::Toolkit - catching errors when plugin is missing?
You should be able to pop the offending code into a BEGIN block, replacing use with require and wrap with eval to catch any failures:
BEGIN { eval { require Stash; require Dumper; $Dumper::Indent = 1; Dumper.dump( Stash.stash() ) }; }
Another thing I tend to do with debug code is set a constant (such as DEBUG) and make sure all of my debug code is wrapped up with if DEBUG statements, which completely strips the code out when not running in debug mode
|
|---|