From f1275c0a79f06e02811bf0c34c74665b906bc2b7 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 18 Apr 2009 11:53:51 +0200 Subject: efa: Don't print trailing separation mark ("------") --- bin/efa | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/efa b/bin/efa index 3a4af9f..4f65e98 100755 --- a/bin/efa +++ b/bin/efa @@ -23,6 +23,7 @@ my ($time, $time_depart, $time_arrive); my $date; my $restrict; my $debug = 0; +my ($i, $j, $con, $part); $post{type_origin} = 'stop'; $post{type_destination} = 'stop'; @@ -175,15 +176,17 @@ if ($debug) { $cons = parse_content($raw); -foreach (@$cons) { - foreach (@$_) { +for ($i = 0; $con = $cons->[$i]; $i++) { + for ($j = 0; $part = $con->[$j]; $j++) { printf( "%-5s %-2s %-30s %-20s %s\n%-5s %-2s %-30s\n\n", - $_->{deptime}, $_->{dep}, $_->{depstop}, $_->{deptrain}, - $_->{depdest}, $_->{arrtime}, $_->{arr}, $_->{arrstop} + $part->{deptime}, $part->{dep}, $part->{depstop}, $part->{deptrain}, + $part->{depdest}, $part->{arrtime}, $part->{arr}, $part->{arrstop} ); } - print "------\n\n"; + if (defined($cons->[$i+1])) { + print "------\n\n"; + } } __END__ -- cgit v1.2.3