From 4da3a72be49f769c307381d92320bc7baefe2a01 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 23 May 2011 11:14:22 +0200 Subject: Introducing ::Route and ::Route::Part --- bin/efa | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/efa b/bin/efa index 820ff52..f257532 100755 --- a/bin/efa +++ b/bin/efa @@ -100,12 +100,12 @@ $efa->submit( timeout => $opt->{'timeout'} ); $efa->parse(); -my @connections = $efa->connections(); +my @routes = $efa->routes(); -for my $i ( 0 .. $#connections ) { - for my $c ( @{ $connections[$i] } ) { +for my $i ( 0 .. $#routes ) { + for my $c ( $routes[$i]->parts() ) { - for my $extra ( @{ $c->{'extra'} } ) { + for my $extra ( $c->extra() ) { if ( not( length $ignore_info and $extra =~ /$ignore_info/i ) ) { say "# $extra"; @@ -114,11 +114,13 @@ for my $i ( 0 .. $#connections ) { printf( "%-5s ab %-30s %-20s %s\n%-5s an %-30s\n\n", - $c->{'dep_time'}, $c->{'dep_stop'}, $c->{'train_line'}, - $c->{'train_dest'}, $c->{'arr_time'}, $c->{'arr_stop'}, + $c->get( + qw(dep_time dep_stop train_line train_dest arr_time + arr_stop) + ), ); } - if ( $i != $#connections ) { + if ( $i != $#routes ) { print "------\n\n"; } } -- cgit v1.2.3