This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Typos in opcode.pl this time.
[perl5.git] / regcomp.pl
index 6ae8478..e7a9d05 100644 (file)
@@ -1,3 +1,7 @@
+BEGIN {
+    # Get function prototypes
+    require 'regen_lib.pl';
+}
 #use Fatal qw(open close rename chmod unlink);
 open DESC, 'regcomp.sym';
 $ind = 0;
@@ -18,9 +22,11 @@ $tmp_h = 'tmp_reg.h';
 unlink $tmp_h if -f $tmp_h;
 
 open OUT, ">$tmp_h";
+binmode OUT;
 
 print OUT <<EOP;
-/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
+/* -*- buffer-read-only: t -*-
+   !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
    This file is built by regcomp.pl from regcomp.sym.
    Any changes made here will be lost!
 */
@@ -110,10 +116,9 @@ static const int reg_num = $tot;
 #endif /* DEBUGGING */
 #endif /* REG_COMP_C */
 
+/* ex: set ro: */
 EOP
 
-close OUT;
+close OUT or die "close $tmp_h: $!";
 
-chmod 0666, 'regnodes.h';
-unlink 'regnodes.h';
-rename $tmp_h, 'regnodes.h';
+safer_rename $tmp_h, 'regnodes.h';