lalitbans has asked for the wisdom of the Perl Monks concerning the following question:

I have a problem with Net::FTP module :-

use Net::FTP; my $ftp = Net::FTP->new("192.168.32.12", Debug => 1) || print $@; $ftp->login('username','password') || print $ftp->message; print $ftp->pwd();

It will run correctly but if i change the program little bit, likewise :-

my $hash = {'user' => username, pass' => 'password', }; my $username = $hash->{user}; my $password = $hash->{pass}; $ftp->login($username, $password) || print $ftp->message; print $ftp->pwd();

Now it'll not going to connect with the FTP server. Anyone having idea or already faced issue, please share your comments.

Replies are listed 'Best First'.
Re: Problem with Net::FTP login
by Anonymous Monk on Mar 29, 2013 at 11:12 UTC
    The 2nd code you posted doesn't compile  Bad name after pass' your quoting is broken
      use strict;
      use warnings;
      Always use stricter to figure out the issue easily.