summaryrefslogtreecommitdiff
path: root/regen_perly.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-14 21:59:38 +0100
committerNicholas Clark <nick@ccl4.org>2011-05-19 10:18:15 +0100
commitcc49830d6031e8e74c0426f77e2b3589e5774765 (patch)
tree903934cbbab497476834e5c4c83473324fc0a3ac /regen_perly.pl
parent515c3fe0106d244307cd4e79b0a9b86dd95973e4 (diff)
downloadperl-cc49830d6031e8e74c0426f77e2b3589e5774765.tar.gz
Add an optional third argument to open_new(), to invoke read_only_top() with.
Merge together many calls to open_new() and read_only_top().
Diffstat (limited to 'regen_perly.pl')
-rw-r--r--regen_perly.pl13
1 files changed, 5 insertions, 8 deletions
diff --git a/regen_perly.pl b/regen_perly.pl
index 668f1642fe..a96a918811 100644
--- a/regen_perly.pl
+++ b/regen_perly.pl
@@ -97,13 +97,13 @@ my ($actlines, $tablines) = extract($clines);
$tablines .= make_type_tab($y_file, $tablines);
-my $read_only = read_only_top(lang => 'C', by => $0, from => $y_file);
+my ($act_fh, $tab_fh, $h_fh) = map {
+ open_new($_, '>', { by => $0, from => $y_file });
+} $act_file, $tab_file, $h_file;
-my $act_fh = open_new($act_file);
-print $act_fh $read_only, $actlines;
+print $act_fh $actlines;
-my $tab_fh = open_new($tab_file);
-print $tab_fh $read_only, $tablines;
+print $tab_fh $tablines;
unlink $tmpc_file;
@@ -112,9 +112,6 @@ unlink $tmpc_file;
# C<#line 188 "perlytmp.h"> gets picked up by make depend, so remove them.
open my $tmph_fh, '<', $tmph_file or die "Can't open $tmph_file: $!\n";
-my $h_fh = open_new($h_file);
-
-print $h_fh $read_only;
my $endcore_done = 0;
# Token macros need to be generated manually on bison 2.4