From: Mischa POSLAWSKY Date: Mon, 26 Aug 2024 18:04:58 +0000 (+0200) Subject: browser: replace smartmatch by equivalent syntax X-Git-Tag: v1.20~8 X-Git-Url: http://git.shiar.net/sheet.git/commitdiff_plain/ee5b8a7f10f8dfebfed4948b33f45c4d9cbfe068 browser: replace smartmatch by equivalent syntax --- 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';