diff options
author | Daniel Friesel <derf@finalrewind.org> | 2013-02-13 21:07:30 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2013-02-13 21:07:30 +0100 |
commit | 1880e63fc3febe5921316555023da8004c31927e (patch) | |
tree | 16f6f85193f35f53abc8a34816dc34079f11a24c /cgi | |
parent | 8c48d615f7e8b737ab5f9003e89357f22c485211 (diff) |
code cleanup
Diffstat (limited to 'cgi')
-rw-r--r-- | cgi/index.pl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cgi/index.pl b/cgi/index.pl index c26b965..0667351 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -4,6 +4,7 @@ use Cache::File; use DateTime; use DateTime::Format::Strptime; +use List::MoreUtils qw(any); use App::VRR::Fakedisplay; use Travel::Status::DE::DeutscheBahn; @@ -151,7 +152,7 @@ sub render_image { my $backend = $self->param('backend'); my ( @grep_line, @grep_platform ); - my $offset = 0; + my $offset = 0; my $displayed_lines = 0; my ( $results, $errstr ) = get_results( $backend, $city, $stop ); @@ -210,14 +211,15 @@ sub render_image { // $strp_simple->parse_datetime($time); my $dt; - if ( ( @grep_line and not( grep { $line =~ $_ } @grep_line ) ) + if ( ( @grep_line and not( any { $line =~ $_ } @grep_line ) ) or ( @grep_platform and not( $platform ~~ \@grep_platform ) ) or ( $line =~ m{ ^ (RB | RE | IC | EC) }x ) ) { next; } - if ($d->delay eq '-9999') { + if ( $d->delay eq '-9999' ) { + # canceled next; } @@ -277,10 +279,10 @@ sub render_image { $png->new_line(); } - if ($displayed_lines == 0) { + if ( $displayed_lines == 0 ) { $png->new_line(); $png->new_line(); - $png->draw_at(50, 'no departures'); + $png->draw_at( 50, 'no departures' ); } $self->render( data => $png->png ); |