From ee5b8a7f10f8dfebfed4948b33f45c4d9cbfe068 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 26 Aug 2024 20:04:58 +0200 Subject: [PATCH] browser: replace smartmatch by equivalent syntax --- browser.plp | 13 ++++++------- tools/mkcharinfo | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/browser.plp b/browser.plp index c32e808..5a48f77 100644 --- a/browser.plp +++ b/browser.plp @@ -1,6 +1,5 @@ <(common.inc.plp)><: use List::Util qw(sum max first); -no if $] >= 5.018, warnings => 'experimental::smartmatch'; Html({ title => 'browser compatibility cheat sheet', @@ -83,19 +82,19 @@ say '

Alternate rendition of '.$ref; my ($canihas, $usage); my $minusage = $get{threshold} // 1; -given ($get{usage} // 'wm') { - when (!$_) { - # none - } - when (!m{ \A [a-z]\w+ (?:/\d[\d-]*\d)? \z }x) { +for ($get{usage} // 'wm') { + $_ or next; # none + unless (m{ \A [a-z]\w+ (?:/\d[\d-]*\d)? \z }x) { Alert([ 'Invalid browser usage data request', 'Identifier must be alphanumeric name or 0.', ]); + next; } + $canihas = eval { Data("data/browser/usage-$_") } or do { Alert('Browser usage data not found', $@); - break; + next; }; $usage = $_; my $ref = $canihas->{-title} || 'unknown'; diff --git a/tools/mkcharinfo b/tools/mkcharinfo index 8bf3d54..088a1ac 100755 --- a/tools/mkcharinfo +++ b/tools/mkcharinfo @@ -2,7 +2,6 @@ use 5.014; use warnings; use utf8; -no if $] >= 5.018, warnings => 'experimental::smartmatch'; use lib '.'; use open OUT => ':encoding(utf-8)', ':std'; -- 2.30.2