try { die "foobar"; } catch { print "failed\n"; exit; } print "ok";