Bad protocol 'tcp' with perl/lwp module connections

2004-07-16 Thread Dirk Fokken, Cross Development
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:

http://192.168.0.5/cgi-bin/lwp.cgi
 500 Can't connect to search.cpan.org:80 (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 = 'http://search.cpan.org/search');
  $req-content_type('application/x-www-form-urlencoded');
  $req-content('query=libwww-perlmode=dist');

  # 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

on 

Windows 2000 Professional Ver 5.0 Build 2195

 + Apache/1.3.29 

Many thanks for help.

Kind regards,

Dirk


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Problem: Perl with connections using LWP Module

2004-07-15 Thread Dirk Fokken, Cross Development
In an attempt to run a perl based web-application on Windows using Cygwin with Apache, 
I experience difficulties requesting content using the LWP module.

The overall installation of Cygwin and the additional modules seems to be fine, since 
the call of the specific cgi-script from the command line works. 

Calling the cgi-script from within the browser I receive the following message:

Can't connect to www.crossdesktop.de:80 (Bad protocol 'tcp')

In my opinion, the difference between a call from the command line and a call by the 
browser may be the uid:gid being set differently. Therefore, I suppose a rights 
problem to appear here. 

In order to make sure user and group are set equally, in apache's httpd.conf I set 
user and group to the user and group I am in interactive mode. Unfortunately, the 
problem remains.

As principally, the whole system environment seems to be setup working, I come to ask 
this question in the round.

Can someone help? Does someone have a similar experience?

Many thanks,

Dirk




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/