]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/perl/UCW/CGI.pm
UCW::CGI: Updated copyright
[libucw.git] / ucw / perl / UCW / CGI.pm
index c8ec08db22666699ea52207b87372d3561ef8faa..d2468b8fe48b121dd35fca862f5ebbc22d384a4d 100644 (file)
@@ -1,6 +1,6 @@
 #      Poor Man's CGI Module for Perl
 #
 #      Poor Man's CGI Module for Perl
 #
-#      (c) 2002--2010 Martin Mares <mj@ucw.cz>
+#      (c) 2002--2011 Martin Mares <mj@ucw.cz>
 #      Slightly modified by Tomas Valla <tom@ucw.cz>
 #
 #      This software may be freely distributed and used according to the terms
 #      Slightly modified by Tomas Valla <tom@ucw.cz>
 #
 #      This software may be freely distributed and used according to the terms
@@ -134,7 +134,7 @@ sub rfc822_deescape($) {
 sub http_get($) {
        my $h = shift @_;
        $h =~ tr/a-z-/A-Z_/;
 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 ###
 }
 
 ### 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.
 
        # 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;
        $boundary = "--$boundary" unless $agent =~ /MSIE\s+3\.0[12];\s*Mac/;
        $boundary = "\r\n$boundary";
        $boundary_len = length($boundary) + 2;