summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-04-18 11:53:51 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-04-18 11:53:51 +0200
commitf1275c0a79f06e02811bf0c34c74665b906bc2b7 (patch)
tree955eedde862b274ed296fda9b6099ae9e48e6b2f
parent7cbb9bb1284f09a9c55bb42785cc21f37900d3e0 (diff)
efa: Don't print trailing separation mark ("------")
-rwxr-xr-xbin/efa13
1 files 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__