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

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;

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: trouble while ftping through Perl Script
by gellyfish (Monsignor) on Apr 29, 2004 at 12:34 UTC

    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...