Bad protocol 'tcp' with perl/lwp module connections

Dirk Fokken, Cross Development
Fri Jul 16 15:05:00 GMT 2004

Running a cgi script like the following from the command line works pretty fine.

Running the same script from within the browser result in an error message like:
> 500 Can't connect to (Bad protocol 'tcp')

The sample script:
#!/usr/bin/perl -w

use CGI qw(:standard);
print header();

  # Create a user agent object
  use LWP::UserAgent;
  $ua = LWP::UserAgent->new;
  $ua->agent("MyApp/0.1 ");

  # Create a request
  my $req = HTTP::Request->new(POST => '');

  # Pass request to the user agent and get a response back
  my $res = $ua->request($req);

  # Check the outcome of the response
  if ($res->is_success) {
      print $res->content;
  else {
      print $res->status_line, "\n";

System versions are:

    Cygwin DLL version info:
        DLL version: 1.5.10


    Windows 2000 Professional Ver 5.0 Build 2195

     + Apache/1.3.29 

Many thanks for help.

Kind regards,


Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list