]> mj.ucw.cz Git - libucw.git/commitdiff
UCW::CGI: Use "//" instead of "||" where appropriate
authorMartin Mares <mj@ucw.cz>
Tue, 22 Nov 2011 16:14:18 +0000 (17:14 +0100)
committerMartin Mares <mj@ucw.cz>
Tue, 22 Nov 2011 16:14:18 +0000 (17:14 +0100)
ucw/perl/UCW/CGI.pm

index c8ec08db22666699ea52207b87372d3561ef8faa..65c780666b8b314f5bef20cbe2b8c4bf27b7b2af 100644 (file)
@@ -134,7 +134,7 @@ sub rfc822_deescape($) {
 sub http_get($) {
        my $h = shift @_;
        $h =~ tr/a-z-/A-Z_/;
-       return $ENV{"HTTP_$h"} || $ENV{"$h"};
+       return $ENV{"HTTP_$h"} // $ENV{"$h"};
 }
 
 ### Parsing of Arguments ###
@@ -345,7 +345,7 @@ sub parse_multipart_form_data() {
 
        # BUG: IE 3.01 on Macintosh forgets to add the "--" at the start of the boundary string
        # as the MIME specs preach. Workaround borrowed from CGI.pm in Perl distribution.
-       my $agent = http_get("User-Agent") || "";
+       my $agent = http_get("User-Agent") // "";
        $boundary = "--$boundary" unless $agent =~ /MSIE\s+3\.0[12];\s*Mac/;
        $boundary = "\r\n$boundary";
        $boundary_len = length($boundary) + 2;