fix overload.pl to use rename_if_different, imitating reentr.pl
(including commenting safer_unlink rather than scrubbing it).
Leave lib/overload/number.pm unconditionally generated,
since it is not a dependency for make perl
With this, "make regen perl; make regen perl" will recompile at most 1x.
In turn, this improves utility of regen as an added default make target.
push @names, $name;
}
-safer_unlink ('overload.h', 'overload.c', catfile(qw(lib overload numbers.pm)));
-my $c = safer_open("overload.c");
-my $h = safer_open("overload.h");
+safer_unlink (catfile(qw(lib overload numbers.pm)));
+my $c = safer_open("overload.c-new");
+my $h = safer_open("overload.h-new");
mkdir("lib/overload") unless -d catdir(qw(lib overload));
my $p = safer_open(catfile(qw(lib overload numbers.pm)));
safer_close($h);
safer_close($c);
safer_close($p);
+rename_if_different("overload.c-new", "overload.c");
+rename_if_different("overload.h-new","overload.h");
__DATA__
# Fallback should be the first