summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/DBInfoscreen.pm2
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm27
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;