Subject: | restarts established by 'restart_case' linger on |
After 'restart_case' establishes a set of restarts, it doesn't clean up
after itself. The restarts remain active long after 'restart_case' has
returned and can be invoked from other scopes.
$ cat restart.pl
#!perl
use warnings;
use strict;
use ConditionSystem;
{
package Exception;
sub new { bless {}, $_[0] }
}
with_handlers {
restart_case {
Exception->new
}
bind_continue(say_hi => sub { print "hi\n"; })
}
handle(Exception => restart('say_hi'));
with_handlers {
die Exception->new;
}
handle(Exception => restart('say_hi'));
__END__
$ perl restart.pl
hi
hi
Expected output:
hi
<error: no such restart: 'say_hi'>
or some other kind of error for the second restart() call.