use strict; use XML::Parser; my $p1 = new XML::Parser(Style => 'Subs'); $p1->parse('Hello World'); sub foo { my ($expat, $tag, %a) = @_; print "foo before death\n"; die "i cannot die"; print "foo after death\n"; } sub foo_ { my ($expat, $tag, %a) = @_; print "i am alive and running foo_\n"; }