<(common.inc.plp)><:
use List::Util qw(sum max first);
-no if $] >= 5.018, warnings => 'experimental::smartmatch';
Html({
title => 'browser compatibility cheat sheet',
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 <q>0</q>.',
]);
+ 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';