We don't want to propagate %SIG changes to other tests when
running multiple tests within the same process via t/run.perl.
for my $v (qw(V1 V2)) {
my @warn;
for my $v (qw(V1 V2)) {
my @warn;
- $SIG{__WARN__} = sub { push @warn, @_ };
+ local $SIG{__WARN__} = sub { push @warn, @_ };
my $cfgpfx = "publicinbox.$v";
my $inboxdir = "$tmpdir/$v";
my $addr = "test-$v\@example.com";
my $cfgpfx = "publicinbox.$v";
my $inboxdir = "$tmpdir/$v";
my $addr = "test-$v\@example.com";
$for_leafnode->header_set('Message-ID', @mids);
$for_leafnode->body_set('not-a-dupe');
my $warn = '';
$for_leafnode->header_set('Message-ID', @mids);
$for_leafnode->body_set('not-a-dupe');
my $warn = '';
- $SIG{__WARN__} = sub { $warn .= join('', @_) };
+ local $SIG{__WARN__} = sub { $warn .= join('', @_) };
$im->add($for_leafnode);
$im->done;
like($warn, qr/reused/, 'warned for reused MID');
$im->add($for_leafnode);
$im->done;
like($warn, qr/reused/, 'warned for reused MID');
for my $v (@v) {
my @warn;
for my $v (@v) {
my @warn;
- $SIG{__WARN__} = sub { push @warn, @_ };
+ local $SIG{__WARN__} = sub { push @warn, @_ };
my $cfgpfx = "publicinbox.$v";
my $inboxdir = "$tmpdir/$v";
my $maildir = "$tmpdir/md-$v";
my $cfgpfx = "publicinbox.$v";
my $inboxdir = "$tmpdir/$v";
my $maildir = "$tmpdir/md-$v";