Subject: | CGI.pm doesnt use binmode() on NetWare platform |
Date: | Wed, 6 Jun 2007 02:54:48 +0200 |
To: | bug-CGI.pm [...] rt.cpan.org |
From: | Guenter Knauf <info [...] gknw.de> |
Hi Lincoln,
while testing with POST data I found that CGI.pm doesnt use binmode() on NetWare;
below is a patch against CGI.pm 3.29 which fixes this:
###########################################################################
# patch to fix CGI.pm to use binmode() on NetWare -- by G. Knauf. #
###########################################################################
--- CGI.pm.orig Mon Apr 16 18:58:46 2007
+++ CGI.pm Wed Jun 06 02:45:06 2007
@@ -155,12 +155,14 @@
$OS = 'EPOC';
} elsif ($OS =~ /^cygwin/i) {
$OS = 'CYGWIN';
+} elsif ($OS =~ /^NetWare/i) {
+ $OS = 'NETWARE';
} else {
$OS = 'UNIX';
}
# Some OS logic. Binary mode enabled on DOS, NT and VMS
-$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin|CYGWIN)/;
+$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin|CYGWIN|NETWARE)/;
# This is the default class for the CGI object to use when all else fails.
$DefaultClass = 'CGI' unless defined $CGI::DefaultClass;
@@ -171,7 +173,7 @@
# The path separator is a slash, backslash or semicolon, depending
# on the paltform.
$SL = {
- UNIX => '/', OS2 => '\\', EPOC => '/', CYGWIN => '/',
+ UNIX => '/', OS2 => '\\', EPOC => '/', CYGWIN => '/', NETWARE => '/',
WINDOWS => '\\', DOS => '\\', MACINTOSH => ':', VMS => '/'
}->{$OS};
thanks, Guenter.
###########################################################################
# patch to fix CGI.pm to use binmode() on NetWare -- by G. Knauf. #
###########################################################################
--- CGI.pm.orig Mon Apr 16 18:58:46 2007
+++ CGI.pm Wed Jun 06 02:45:06 2007
@@ -155,12 +155,14 @@
$OS = 'EPOC';
} elsif ($OS =~ /^cygwin/i) {
$OS = 'CYGWIN';
+} elsif ($OS =~ /^NetWare/i) {
+ $OS = 'NETWARE';
} else {
$OS = 'UNIX';
}
# Some OS logic. Binary mode enabled on DOS, NT and VMS
-$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin|CYGWIN)/;
+$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin|CYGWIN|NETWARE)/;
# This is the default class for the CGI object to use when all else fails.
$DefaultClass = 'CGI' unless defined $CGI::DefaultClass;
@@ -171,7 +173,7 @@
# The path separator is a slash, backslash or semicolon, depending
# on the paltform.
$SL = {
- UNIX => '/', OS2 => '\\', EPOC => '/', CYGWIN => '/',
+ UNIX => '/', OS2 => '\\', EPOC => '/', CYGWIN => '/', NETWARE => '/',
WINDOWS => '\\', DOS => '\\', MACINTOSH => ':', VMS => '/'
}->{$OS};