use Carp; foo(); sub foo { print "foo\n"; bar(); } sub bar { print "bar\n"; baz(); } sub baz { print "baz\n"; confess "エラー"; }