X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/58725794d72361cc70cb082476a32d08e22d21d0..ae48ceadbe58905cc69e046c2182e5bb83bf305f:/browser.plp?ds=inline diff --git a/browser.plp b/browser.plp index 6d75d4a..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', @@ -14,7 +13,6 @@ Html({ html html5 css css3 svg javascript js dom mobile ie internet explorer firefox chrome safari webkit opera '], - stylesheet => [qw'circus dark mono red light'], data => ['data/browser/support.inc.pl'], }); @@ -84,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';