X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/7ee7a878e0b44cd8306fb0ff35ddbcee216bd7d9..fc0efae244f2c4bf8063f5962138c2469dc44e6e:/browser.plp diff --git a/browser.plp b/browser.plp index d8ebf86..375f300 100644 --- a/browser.plp +++ b/browser.plp @@ -2,6 +2,7 @@ use 5.010; use utf8; use List::Util qw(sum max first); +no if $] >= 5.018, warnings => 'experimental::smartmatch'; Html({ title => 'browser compatibility cheat sheet', @@ -21,7 +22,7 @@ Html({ say "

Browser compatibility

\n"; -my $caniuse = do 'data/browser/support.inc.pl' or die $! || $@; +my $caniuse = do 'data/browser/support.inc.pl' or die $@ || $!; $_->{verrelease} = { # mark last three (future) versions as unreleased, ensure current isn't map { @@ -98,7 +99,7 @@ given ($get{usage} // 'wm') { 'identifier must be alphanumeric name or 0'; } $canihas = do "data/browser/usage-$_.inc.pl" or do { - printf "

Browser usage data not found: %s", $! || $@; + printf "

Browser usage data not found: %s", $@ || $!; break; }; $usage = $_; @@ -268,8 +269,8 @@ sub featurescore { if ($canihas) { while (my ($browser, $versions) = each %$row) { ref $versions eq 'HASH' or next; - while (my ($version, $_) = each %$versions) { - $rank += ($canihas->{$browser}->{$version} || .001) * $PSTATS{$_}; + while (my ($version, $status) = each %$versions) { + $rank += ($canihas->{$browser}->{$version} || .001) * $PSTATS{$status}; } } return $rank;