chiark / gitweb /
Dump optimisation results too
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 23 Aug 2009 10:47:04 +0000 (11:47 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 23 Aug 2009 10:47:04 +0000 (11:47 +0100)
yarrg/web/dumptable
yarrg/web/routetrade

index 20dc25f12ceb4ea7a77e51302e7ec9557b53e10a..e60415c8469bae1c94dd8ed5851bfe84e48588a4 100644 (file)
@@ -96,6 +96,19 @@ $qa => undef
 %      }
 </%method>
 
+<%method literal>
+<%args>
+$cols
+$rows
+$qa => undef
+</%args>
+<& SELF:start, cols => $cols &>
+%      foreach my $row (@$rows) {
+<& SELF:row, cols => $cols, row => $row &>
+%      }
+<& SELF:end &>
+</%method>
+
 <& SELF:start, sth => $sth &>
 %      my $row;
 %      while ($row= $sth->fetchrow_hashref) {
index fa29e6a596936a933917d21368d28e52c069cabb..9c2a5a423fdda83fe833c43ceb2ba02462df6a79 100644 (file)
@@ -255,7 +255,8 @@ print join ' ', map { $_->{Optimal} } @flows;
 push @columns, qw(Opt_qty Opt_profit);
 
 </%perl>
-<% join ' ', @columns %>
+
+<& dumptable:literal, cols => \@columns, rows => \@flows &>
 
 % } # ========== OPTIMISATION ==========