>> And: if it has to change everywhere then what would the best approach >> be? >> Placing it in a separate function? (If so, in what file, what >> name, ...) My current plan: Adding Perl_sv_setpvn_clearmg in sv.c which basically contains: sv_setpvn(sv,ptr,len); if (SvMAGICAL(sv)) { mg_free(sv); mg_clear(sv); } SvPOK_only(sv); Defining sv_setpvn_clearmg in embed.h #define sv_setpvn_clearmg Perl_sv_setpvn_clearmg Changing: sv_setpvn(ERRSV,"",0) into sv_setpvn_clearmg(ERRSV,"",0); Testing-A: eval { 1 }; eval { die "\x{a10d};"; } $_ = length $@; eval { 1 }; print "ok" if (not $@ and not length $@); Testing-B: use Devel::Peek; eval { 1 }; { no warnings; $_ = $@ + 0 } my $eval_1 = _get_output_of_Dump($@); eval { die "\x{a10d};"; } $_ = length $@; eval { 1 }; my $eval_2 = _get_output_of_Dump($@); print "ok" if $eval_1 eq $eval_2; The $@ + 0 is needed because the Dump of the second eval always includes: IV = 0 NV = 0 Which the first does not. (Or is there another way to get rid of it?) Can someone comment on this approach? Kind regards, BramThread Previous | Thread Next