This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
In pp_regcomp and pp_entereval, use newSVpvn_flags() to simplify code.
[perl5.git]
/
keywords.pl
diff --git
a/keywords.pl
b/keywords.pl
index
8e7a678
..
7ce010e
100755
(executable)
--- a/
keywords.pl
+++ b/
keywords.pl
@@
-1,11
+1,21
@@
#!/usr/bin/perl -w
#!/usr/bin/perl -w
+#
+# Regenerate (overwriting only if changed):
+#
+# keywords.h
+#
+# from information stored in the DATA section of this file.
+#
+# Accepts the standard regen_lib -q and -v args.
+#
+# This script is normally invoked from regen.pl.
+
use strict;
require 'regen_lib.pl';
use strict;
require 'regen_lib.pl';
-open(KW, ">keywords.h-new") || die "Can't create keywords.h: $!\n";
-binmode KW;
-select KW;
+my $kw = safer_open("keywords.h-new");
+select $kw;
print <<EOM;
/* -*- buffer-read-only: t -*-
print <<EOM;
/* -*- buffer-read-only: t -*-
@@
-35,11
+45,11
@@
while (<DATA>) {
print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
}
print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
}
-print
KW
"\n/* ex: set ro: */\n";
+print
$kw
"\n/* ex: set ro: */\n";
-
close KW or die "Error closing keywords.h: $!"
;
+
safer_close($kw)
;
-
safer_rename
("keywords.h-new", "keywords.h");
+
rename_if_different
("keywords.h-new", "keywords.h");
###########################################################################
sub tab {
###########################################################################
sub tab {