diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-09-01 10:53:23 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-09-01 10:53:23 +0200 |
commit | 18c919fe959905141924a5f0b49865e59f2453ff (patch) | |
tree | d9bc59901730a03b234e0deee5042b59d1bbdb6b | |
parent | 11ea0db3d6bd20e38b0eaab45d69c850256a0b5d (diff) |
do not use now-deprecated smartmatch feature4.17.1
-rw-r--r-- | lib/DBInfoscreen.pm | 2 | ||||
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 27 |
2 files changed, 18 insertions, 11 deletions
diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index 4618059..092c45f 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -15,8 +15,6 @@ use JSON; use utf8; -no if $] >= 5.018, warnings => 'experimental::smartmatch'; - sub startup { my ($self) = @_; diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index d22443e..3cdf5b8 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -23,8 +23,6 @@ use XML::LibXML; use utf8; -no if $] >= 5.018, warnings => 'experimental::smartmatch'; - my %default = ( mode => 'app', admode => 'deparr', @@ -266,7 +264,13 @@ sub json_route_diff { } # this branch is inefficient, but won't be taken frequently - elsif ( not( $route[$route_idx] ~~ \@sched_route ) ) { + elsif ( + not( + List::MoreUtils::any { $route[$route_idx] eq $_ } + @sched_route + ) + ) + { push( @json_route, { @@ -402,7 +406,13 @@ sub handle_request { $self->stash( departures => [] ); $self->stash( title => 'DBF' ); - if ( not( $template ~~ [qw[app infoscreen json multi single text]] ) ) { + if ( + not( + List::MoreUtils::any { $template eq $_ } + (qw(app infoscreen json multi single text)) + ) + ) + { $template = 'app'; } @@ -1344,13 +1354,12 @@ sub handle_result { if ( $template eq 'single' ) { if ( not @platforms ) { for my $result (@results) { + my $num_part + = $self->numeric_platform_part( $result->platform ); if ( - not( $self->numeric_platform_part( $result->platform ) ~~ - \@platforms ) - ) + not( List::MoreUtils::any { $num_part eq $_ } @platforms ) ) { - push( @platforms, - $self->numeric_platform_part( $result->platform ) ); + push( @platforms, $num_part ); } } @platforms = sort { $a <=> $b } @platforms; |