>> >> When setting a localized signal handler, the system signal handler >> >> is set to SIG_DFL then back to perl's signal handler. This briefly >> >> exposes SIG_DFL when switching between alternate non-default signal >> >> handlers. > > > > The below patch fixes this bug. In the process it also partially fixes a > > magic bug of long standing (probably since 5.000). > > > > When localizing a magical scalar for assignment, Perl has until now done an > > extra store of undef before storing the actual desired value. To > > illustrate, given this source code: > > > > { package Foo; > > sub TIEHASH { bless {}, 'Foo' } > > sub FETCH { print "Fetch $_[1]\n"; $_[0]->{$_[1]} } > > sub STORE { print "Store $_[1] = $_[2]\n"; $_[0]->{$_[1]} = $_[2] } > > } > > > > tie %x, 'Foo'; > > $x{plugh} = "dick"; > > { local $x{plugh} = "jane" } > > > > Released perls and blead do this: > > > > $ perl foo > > Store plugh = dick > > Fetch plugh > > Store plugh = > > Store plugh = jane > > Store plugh = dick > > > > Whereas blead with the below patch does this: > > > > $ ./perl foo > > Store plugh = dick > > Fetch plugh > > Store plugh = jane > > Store plugh = dick > > > > The below patch fixes this problem for hash elements and slices. However, > > due to the OPf_SPECIAL flag not meaning the same thing in the AELEM opcodes, > > let alone all the opcodes that can extract scalar values, this fix is not > > entirely applicable to those cases; that will require deeper hacking. At > > least this patch fixes hashes, which are the most common case. Great fix! Thanks, applied as #34819, except the perlapi.c part, which strips off a Tolkien quote. I'll fix that separately.