# be nice to callers - don't wipe out $@ for them local $@; eval { # ... do some stuff ... # make sure we only return false if we die before # the end return 1; } or do { #handle errors here }