Unable to connect a website using LWP



Hi,

Iam trying to connect to a website
ftp://ftp.rcsb.org/pub/pdb/data/structures/all/pdb/ to download files
from there. I am using LWP for the same and I am getting the following
Error

Cant get ftp://ftp.rcsb.org/pub/pdb/data/structures/all/pdb/:
HTTP::Response=HASH(0x98ceb34)->status_line at try.pl line 18.

Where can I know what this error code stands for?

Here is the portion of the code referring to this problem

#! /usr/bin/perl

use warnings;
use strict;
use lib '/home/ms2/PERL/LWP/libwww-perl-5.800/lib/';
use LWP;

#Create a UserAgent object

use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

#need to make a get request

my $url = 'ftp://ftp.rcsb.prg/pub/pdb/data/structures/all/pdb/';
my $response = $ua->get($url);

if ($response->is_success == 0 ) { die "Cant get $url:\n
$response->status_line"; }

else { # do something }
......other sections of code not added here ......

One more very basic question - what is the difference between CGI and
LWP and when do we use each-- that is- is LWP for client side
scripting and CGI for server side scripting?

Any help appreciated
Thanks

.



Relevant Pages

  • Re: Unable to connect a website using LWP
    ... Does LWP handle FTP addresses? ... Where can I know what this error code stands for? ... CGI programs reside on a webserver. ...
    (comp.lang.perl.modules)
  • Re: Explicitly telling LWP::UserAgent where Crypt::SSLeay is
    ... > use CGI; ... The reason I ask is that LWP uses Crypt::SSLeay under the covers so ... https requests should work transparently if Crypt::SSLeasy is usable. ...
    (comp.lang.perl.modules)
  • Re: LWP with proxy problem
    ... >> the content of the login page for the site being accessed. ... I also am including the LWP ... This has nothing to do with CGI. ... actually a web client, the example code does not appear related to any ...
    (comp.lang.perl.misc)
  • Re: CGI::Carp die with status
    ... Has anyone experience with dying from CGI::Carp with a status? ... Using LWP one can catch status with: ... on the server. ... You need to post the cgi if you want help fixing it. ...
    (comp.lang.perl.misc)
  • Re: how to get the table from a website and display
    ... cgi i know how to do but cfm i ... It doesn't really matter what the site is using (except applets - LWP ...
    (comp.lang.perl.misc)