diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-09-07 16:01:08 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-09-07 16:01:08 +0200 |
commit | 76933635af54fb97fdc8e592e074cc4e5a262f52 (patch) | |
tree | 7afded98134d2a633e188c3dafdb486c48fe9d49 | |
parent | 2b5c10e8cd95e499cf96bcf234c1ceb7c8dd9dd5 (diff) |
don't use smartmatch any longer
-rw-r--r-- | lib/JWebmail.pm | 4 | ||||
-rw-r--r-- | lib/JWebmail/Controller/Webmail.pm | 6 | ||||
-rw-r--r-- | templates/displayheaders/_main_table.html.ep | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/JWebmail.pm b/lib/JWebmail.pm index e672903..e2c291c 100644 --- a/lib/JWebmail.pm +++ b/lib/JWebmail.pm @@ -124,8 +124,8 @@ sub _mail_line { \s*<$mail_addr> ) | ( $mail_addr - ))$ - /xn; + ) + )$/xn; } sub _filter_empty_upload { diff --git a/lib/JWebmail/Controller/Webmail.pm b/lib/JWebmail/Controller/Webmail.pm index acf7557..e06a8f7 100644 --- a/lib/JWebmail/Controller/Webmail.pm +++ b/lib/JWebmail/Controller/Webmail.pm @@ -3,7 +3,7 @@ package JWebmail::Controller::Webmail; use Mojo::Base Mojolicious::Controller; use Carp 'carp'; -use List::Util 'first'; +use List::Util qw(any first); use Mojo::Util qw(encode decode b64_encode b64_decode); use Mojolicious::Types; @@ -141,7 +141,7 @@ sub displayheaders { my $folders = _time { $self->users->folders($auth) } $self, 'user folders'; - unless ( !$self->stash('folder') || $self->stash('folder') ~~ $folders ) { + unless ( !$self->stash('folder') || any { $self->stash('folder') eq $_ } @$folders ) { $self->render(template => 'error', status => 404, error => $self->l('no_folder'), @@ -305,7 +305,7 @@ sub move { my $folder = $self->param('folder'); no warnings 'experimental::smartmatch'; - die "$folder not valid" unless $folder ~~ $folders; + die "$folder not valid" unless any { $folder eq $_ } @$folders; $self->users->move($auth, $_, '', $folder) for @$mm; diff --git a/templates/displayheaders/_main_table.html.ep b/templates/displayheaders/_main_table.html.ep index e06e925..c88e125 100644 --- a/templates/displayheaders/_main_table.html.ep +++ b/templates/displayheaders/_main_table.html.ep @@ -3,7 +3,7 @@ %= link_to url_with->query(sort => $param eq (param('sort') || '') ? '!' . $param : $param) => begin % no warnings qw(experimental::smartmatch); - %= do { given (param('sort')) { '↑' when ($param); '↓' when ('!' . $param) } } + %= do { if (param('sort') eq '↑') { $param } elsif (param('sort') eq '↓') { '!' . $param } else { die } } %= ucfirst l $param; % end |