Subject: | MIME-Types-2.10 broke 5.8 once again |
Date: | Tue, 16 Jun 2015 15:05:17 +0000 |
To: | bug-MIME-Types [...] rt.cpan.org |
From: | Tatsuhiko Miyagawa <miyagawa [...] gmail.com> |
The use of // doesn't make the code compile on perl 5.8.
diff --git a/lib/MIME/Types.pm b/lib/MIME/Types.pm
index b61e561..a216774 100644
--- a/lib/MIME/Types.pm
+++ b/lib/MIME/Types.pm
@@ -167,7 +167,7 @@ sub httpAccept($)
$ !x or next;
my $mime = "$1/$2$4";
- my $q = $3 // 1; # q, default=1
+ my $q = $3; $q = 1 unless defined $q; # q, default=1
# most complex first
$q += $4 ? +0.01 : $1 eq '*' ? -0.02 : $2 eq '*' ? -0.01 : 0;