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
RT 43789: "in memory" files don't call STORE
[perl5.git]
/
keywords.pl
diff --git
a/keywords.pl
b/keywords.pl
index
2f3a95a
..
7ce010e
100755
(executable)
--- a/
keywords.pl
+++ b/
keywords.pl
@@
-1,18
+1,29
@@
-#!/usr/bin/perl
+#!/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';
require 'regen_lib.pl';
-safer_unlink ("keywords.h");
-open(KW, ">keywords.h") || 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 -*-
*
* keywords.h
*
print <<EOM;
/* -*- buffer-read-only: t -*-
*
* keywords.h
*
- * Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
- * by Larry Wall and others
+ * Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
2005,
+ *
2006, 2007,
by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
@@
-25,22
+36,24
@@
EOM
# Read & print data.
# Read & print data.
-$keynum = 0;
+
my
$keynum = 0;
while (<DATA>) {
chop;
next unless $_;
next if /^#/;
while (<DATA>) {
chop;
next unless $_;
next if /^#/;
- ($keyword) = split;
+
my
($keyword) = split;
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";
+
+safer_close($kw);
-
close KW or die "Error closing keywords.h: $!"
;
+
rename_if_different("keywords.h-new", "keywords.h")
;
###########################################################################
sub tab {
###########################################################################
sub tab {
-
local
($l, $t) = @_;
+
my
($l, $t) = @_;
$t .= "\t" x ($l - (length($t) + 1) / 8);
$t;
}
$t .= "\t" x ($l - (length($t) + 1) / 8);
$t;
}
@@
-55,6
+68,7
@@
__DATA__
__END__
AUTOLOAD
BEGIN
__END__
AUTOLOAD
BEGIN
+UNITCHECK
CORE
DESTROY
END
CORE
DESTROY
END
@@
-103,7
+117,6
@@
endpwent
endservent
eof
eq
endservent
eof
eq
-err
eval
exec
exists
eval
exec
exists
@@
-257,6
+270,7
@@
sprintf
sqrt
srand
stat
sqrt
srand
stat
+state
study
sub
substr
study
sub
substr