In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/881a210041fba07d64572d6daacf57235c173fee?hp=a4c2757fffb03ea5afbba9313f45bf9f5cb6490e>

- Log -----------------------------------------------------------------
commit 881a210041fba07d64572d6daacf57235c173fee
Author: Nicholas Clark <n...@ccl4.org>
Date:   Tue Sep 21 16:31:41 2010 +0100

    In embed.pl, read embed.fnc into an array, rather than seeking and 
rereading.
-----------------------------------------------------------------------

Summary of changes:
 embed.pl |   39 ++++++++++++++++++++++-----------------
 1 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/embed.pl b/embed.pl
index 7c96be4..a69308c 100755
--- a/embed.pl
+++ b/embed.pl
@@ -94,6 +94,26 @@ EOW
 
 open IN, "embed.fnc" or die $!;
 
+my @embed;
+
+while (<IN>) {
+    chomp;
+    next if /^:/;
+    while (s|\\$||) {
+       $_ .= <IN>;
+       chomp;
+    }
+    s/\s+$//;
+    my @args;
+    if (/^\s*(#|$)/) {
+       @args = $_;
+    }
+    else {
+       @args = split /\s*\|\s*/, $_;
+    }
+    push @embed, \...@args;
+}
+
 # walk table providing an array of components in each line to
 # subroutine, printing the result
 sub walk_table (&@) {
@@ -111,23 +131,8 @@ sub walk_table (&@) {
        $F = safer_open("$filename-new");
     }
     print $F $leader if $leader;
-    seek IN, 0, 0;             # so we may restart
-    while (<IN>) {
-       chomp;
-       next if /^:/;
-       while (s|\\$||) {
-           $_ .= <IN>;
-           chomp;
-       }
-       s/\s+$//;
-       my @args;
-       if (/^\s*(#|$)/) {
-           @args = $_;
-       }
-       else {
-           @args = split /\s*\|\s*/, $_;
-       }
-       my @outs = &{$function}(@args);
+    foreach (@embed) {
+       my @outs = &{$function}(@$_);
        print $F @outs; # $function->(@args) is not 5.003
     }
     print $F $trailer if $trailer;

--
Perl5 Master Repository

Reply via email to