Evaluation order of pass= terms in run statements
Anders Christensen
anders@pvv.unit.no
Tue, 22 Aug 1995 23:33:49 +0200
Version 1.73; patch 003: Order of executing `run' statements (bugfix)
This patch fixes a problem with the `run' statement in the
configuration file. The pass-number given to each `run' statement
(using the `pass=' term) determines the order in which the statements
are run. However, the pass-number was ordered alphabetically, while
documentation and examples indicated numeric order; thus pass=10 was
executed after pass=1 and pass=2. This patch sets the order to
numeric.
Changes introduced in this patch are:
1) A routine called `numerically' is added, in order to be able to
sort numerically. This could be avoided using syntax specific to
Perl 5, but compatibility with Perl 4 is important.
2) The pass numbers are ordered numerically.
Note that a work-around would be to use pass numbers like 01, 02, and
10; or 1a, 1b, and 2a.
diff -ur ver-1.73/lib/runit.pl current/lib/runit.pl
--- ver-1.73/lib/runit.pl Sun May 7 18:03:19 1995
+++ current/lib/runit.pl Tue Aug 22 23:08:17 1995
@@ -9,6 +9,8 @@
undef %fawp ; # File associated with process
undef %cawp ; # Command associated with process
+sub numerically { $a <=> $b; }
+
#
# Find pass number and sort them
#
@@ -18,7 +20,7 @@
$pass = $'runpass{$rnn} ;
++$passes{$pass} ;
}
- @ret = sort (keys %passes) ;
+ @ret = sort numerically (keys %passes) ;
return (@ret) ;
}