diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-01-23 11:15:14 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-01-23 11:15:14 +0000 |
commit | 2d6469fed2ce846fe434cd5b8d5f5938bc345103 (patch) | |
tree | 6d53158793ab6336f48e0392a4d4a8813dd3b73a /regen/overload.pl | |
parent | 3974d06f27877c075f99bc9560d1cd6f23ff9e4e (diff) | |
download | perl-2d6469fed2ce846fe434cd5b8d5f5938bc345103.tar.gz |
In regen scripts, print to explicit file handles instead of using select.
Also put explicit quotes on heredoc declarations to show whether they should
interpolate, merge some heredocs, and remove & from calls to &tab(...)
Diffstat (limited to 'regen/overload.pl')
-rw-r--r-- | regen/overload.pl | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/regen/overload.pl b/regen/overload.pl index fa22bd50a1..88e2153e23 100644 --- a/regen/overload.pl +++ b/regen/overload.pl @@ -35,15 +35,12 @@ my $h = safer_open('overload.h-new', 'overload.h'); mkdir("lib/overload", 0777) unless -d 'lib/overload'; my $p = safer_open('lib/overload/numbers.pm-new', 'lib/overload/numbers.pm'); - -select $p; - -print read_only_top(lang => 'Perl', by => 'regen/overload.pl', - file => 'lib/overload/numbers.pm', copyright => [2008]); +print $p read_only_top(lang => 'Perl', by => 'regen/overload.pl', + file => 'lib/overload/numbers.pm', copyright => [2008]); { local $" = "\n "; -print <<"EOF"; +print $p <<"EOF"; package overload::numbers; our \@names = qw# @@ -68,8 +65,7 @@ for ([$c, 'overload.c'], [$h, 'overload.h']) { 2005 .. 2007, 2011]); } -select $h; -print "enum {\n"; +print $h "enum {\n"; for (0..$#enums) { my $op = $names[$_]; @@ -78,11 +74,11 @@ for (0..$#enums) { die if $op =~ m{\*/}; my $l = 3 - int((length($enums[$_]) + 9) / 8); $l = 1 if $l < 1; - printf " %s_amg,%s/* 0x%02x %-8s */\n", $enums[$_], + printf $h " %s_amg,%s/* 0x%02x %-8s */\n", $enums[$_], ("\t" x $l), $_, $op; } -print <<'EOF'; +print $h <<'EOF'; max_amg_code /* Do not leave a trailing comma here. C9X allows it, C89 doesn't. */ }; |