X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/682883c393a571b058b75bc2e493f5722945a448..e60ccb7426f287532b0cfb89632ff963698530b8:/browser.plp?ds=inline diff --git a/browser.plp b/browser.plp index c32e808..fe96312 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; + Alert('Browser usage data not found', ref $@ ? @{$@} : $@); + next; }; $usage = $_; my $ref = $canihas->{-title} || 'unknown';