in reply to Re: Re: trouble while ftping through Perl Script
in thread trouble while ftping through Perl Script

The problem is that it is not logging in correctly. I would suggest that you use Net::FTP directly whereby you can get the error messages directly:

use strict; use Net::FTP; my $client = Net::FTP->new('ftp.servername.com', Debug => 1) or die "Cannot connect : $@\n"; $client->cwd('/files') or die $client->message(); $client->get('somefile.txt') or die $client->message(); $client->quit()

/J\

Replies are listed 'Best First'.
Re: Re: Re: Re: trouble while ftping through Perl Script
by shilpam (Sexton) on Apr 29, 2004 at 12:28 UTC
    I have tried that too. I gives me an error message:
    Cannot login Login incorrect.
    I know the userid and password are correct....I've tested them directly. Just one doubt, the password contains some back slashes and $ sign. Can that be a problem? But, I am enclosing the password in quotes, so that should not be problem....???
    My code is:
    use Net::FTP; my $ftp = Net::FTP->new("ftp.server.com", Debug => 0) or die "Cannot c +onnect to some.host.name: $@"; my $username = 'username'; my $password = 'pa\ss\wor$d$'; $ftp->login($username,$password) or die "Cannot login ", $ftp->message +; $ftp->cwd("/files") or die "Cannot change working directory ", $ftp->m +essage; $ftp->ls("/files") or die "get failed ", $ftp->message; $ftp->quit;

      my $password = 'pa\ss\wor$d$';

      Well that looks alright in the example you give, but what do you get when you print the $password as you have it in your actual code?

      /J\

        It prints the password exactly as it is. So no problem there...