On Fri, 22 Feb 2002, Kerry Seibold wrote:

>  Hi all,
> I've got a Perl Net::FTP problem.
> My script to get a file from my telstra adsl homepage doesn't work.
> 
> ncftpget -u myuserid -p mypassword ftp.users.bigpond.net.au /tmp index.html
> works fine but my script (see below) hangs at 
>  $ftp->get($filename);
> If I comment out the get line the script finishs execution.
> #$ftp->get($filename);
>  
>  Anyone know what the problem is? 
>  I am running this from the firewall (RH7.1) machine.
>  
>  From O'Reilly "Perl in a Nutshell" P441 Net::FTP
> 
> #!/usr/bin/perl -w
>  
>  # ftpget.cgi rev1.0 21/02/2002 
>  # get a file from an FTP site
>  
>  use Net::FTP;
>  
>  $hostname='ftp.users.bigpond.net.au';
> $username='myuserid';
> $password='mypassword';
> $home='/';
> $filename='index.html';
> 
> $ftp = Net::FTP->new($hostname);    #construct object
> print "logging in\n";
> $ftp->pasv();
> $ftp->login($username,$password);
> print "logged in\n";
> $ftp->cwd($home),"\n";
> $directory=$ftp->pwd();
> print "$directory\n";
> $ftp->get($filename);
> print "logging out\n";
> $ftp->quit;
> print "logged out\n";
> exit; 
> 
> 

OK try experimenting with the pasv(). Also try just getting a file listing 
first. 


-- 
---<GRiP>--- 
Web: www.arcadia.au.com/gripz 
Answering Machine/fax: 02 4950 1194 (wait 5 mins if no answer)
Mobile: 0408 686 201

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to