This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Clarify \c in perlop.pod.
[perl5.git] / overload.pl
index 38331cb..d4ba9a7 100644 (file)
@@ -1,9 +1,18 @@
 #!/usr/bin/perl -w
-
 #
-# Generate overload.h
+# Regenerate (overwriting only if changed):
+#
+#    overload.h
+#    overload.c
+#    lib/overload/numbers.pm
+#
+# from information stored in the DATA section of this file.
+#
 # This allows the order of overloading constants to be changed.
-# 
+#
+# Accepts the standard regen_lib -q and -v args.
+#
+# This script is normally invoked from regen.pl.
 
 BEGIN {
     # Get function prototypes
@@ -23,9 +32,9 @@ while (<DATA>) {
   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)));
 
@@ -141,6 +150,8 @@ EOT
 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
@@ -218,5 +229,6 @@ concat              (.
 concat_ass     (.=
 smart          (~~
 ftest           (-X
+regexp          (qr
 # Note: Perl_Gv_AMupdate() assumes that DESTROY is the last entry
 DESTROY                DESTROY