diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-05-23 11:14:22 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-05-23 11:14:22 +0200 |
commit | 4da3a72be49f769c307381d92320bc7baefe2a01 (patch) | |
tree | e3f0502f3298c14eb04891e1db4a0ea84abb9c82 /bin | |
parent | 194c4ee9eb2eb8eb45af78b8feed39ef53615e1b (diff) |
Introducing ::Route and ::Route::Part
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/efa | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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"; } } |