Re: LWP fails with PerlEXE

Gurusamy Sarathy (gsar@activestate.com)
Thu, 04 Feb 1999 18:24:29 -0800


On Thu, 04 Feb 1999 17:24:43 PST, Gurusamy Sarathy wrote:
>HTTP::Status does not export the RC_INTERNAL_SERVER_ERROR constant, while
>LWP::Protocol thinks it does.  Patch attached.

Wrong patch.  Here's a better one.

The fact that there is no "use HTTP::Response;" in LWP::Protocol
may be a bug.

Sarathy
gsar@activestate.com
-----------------------------------8<-----------------------------------
--- Protocol.pm.dist	Thu Feb 04 16:59:46 1999
+++ Protocol.pm	Thu Feb 04 18:21:42 1999
@@ -38,11 +38,11 @@
 
 require LWP::MemberMixin;
 @ISA = qw(LWP::MemberMixin);
-$VERSION = sprintf("%d.%02d", q$Revision: 1.31 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.32 $ =~ /(\d+)\.(\d+)/);
 
 use strict;
 use Carp ();
-use HTTP::Status 'RC_INTERNAL_SERVER_ERROR';
+use HTTP::Status;
 require HTML::HeadParser;
 
 my %ImplementedBy = (); # scheme => classname
@@ -221,8 +221,8 @@
     elsif (!ref($arg)) {
 	# filename
 	open(OUT, ">$arg") or
-	    return new HTTP::Response RC_INTERNAL_SERVER_ERROR,
-			  "Cannot write to '$arg': $!";
+	    return HTTP::Response->new(&HTTP::Status::RC_INTERNAL_SERVER_ERROR,
+			  "Cannot write to '$arg': $!");
         binmode(OUT);
         local($\) = ""; # ensure standard $OUTPUT_RECORD_SEPARATOR
 	while ($content = &$collector, length $$content) {
@@ -259,8 +259,8 @@
 	}
     }
     else {
-	return new HTTP::Response RC_INTERNAL_SERVER_ERROR,
-				  "Unexpected collect argument  '$arg'";
+	return HTTP::Response->new(&HTTP::Status::RC_INTERNAL_SERVER_ERROR,
+				  "Unexpected collect argument  '$arg'");
     }
     $response;
 }
End of Patch.