From eaae6e31e78eb05f05488db7c7f78d46142549c3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 13 Feb 2013 21:10:26 +0100 Subject: use any instead of boolean grep --- cgi/index.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cgi/index.pl') diff --git a/cgi/index.pl b/cgi/index.pl index 06eb677..1a88a29 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -1,6 +1,7 @@ #!/usr/bin/env perl use Mojolicious::Lite; use Cache::File; +use List::MoreUtils qw(any); use Travel::Status::DE::DeutscheBahn; use 5.014; use utf8; @@ -76,11 +77,11 @@ sub handle_request { my $platform = ( split( / /, $result->platform ) )[0]; if ($via) { my @route = $result->route; - if ( not( grep { $_ =~ m{$via}io } @route ) ) { + if ( not( any { $_ =~ m{$via}io } @route ) ) { next; } } - if ( @platforms and not grep { $_ eq $platform } @platforms ) { + if ( @platforms and not( any { $_ eq $platform } @platforms ) ) { next; } my $info = $result->info; -- cgit v1.2.3