Re: Net::FTP

From: Paul Lalli (mritty_at_gmail.com)
Date: 03/22/05


Date: Tue, 22 Mar 2005 16:30:51 GMT

lucas wrote:
> having trouble listing the files using Net::FTP:
>
> print ">Connecting...";
> my $ftp = Net::FTP->new($addy, Port => $port, Debug => $debug) || die
> "Could Not Connect\n";
> print "Done\n";
>
> print ">Logging in...";
> $ftp->login($user,$pass) || die "Can't Log In\n";
> print "Done\n";
>
> print ">Listing files...";
> @_ = $ftp->ls();
> print "Done\n";
> print "@_\n";
>
> this code returns:
>
> Net::FTP=GLOB(0x82de9d8)>>> PORT 192,168,0,2,129,26
> Net::FTP=GLOB(0x82de9d8)<<< 200 PORT command successful.
> Net::FTP=GLOB(0x82de9d8)>>> NLST
> Net::FTP=GLOB(0x82de9d8)<<< 150 Opening ASCII mode data connection for file
> list.
> Net::FTP=GLOB(0x82de9d8)<<< 226 Transfer complete.
>
>>Listing files...Done
>
> ARRAY(0x8308ef8)
>
> printing @_ just shows "ARRAY(0x8308ef8)". this is the way it's done in the
> examples. anybody know what's wrong with it?

That script works fine for me with Perl 5.8.0 on Solaris, using Net::FTP
2.65. Have you examined the contents of @_ using Data::Dumper to see
what's actually in the reference @_ contains? Try adding these lines:

use Data::Dumper;
print Dumper(\@_);

Also, what versions of Perl and Net::FTP are you using?
perl -v
perl -MNet::FTP -e'print $Net::FTP::VERSION;'

If you're not using at least Perl 5.80 and Net::FTP 2.65, consider
upgrading.



Relevant Pages

  • Re: Getting the list of groups given a user id
    ... I am working on a script that would run on Solaris and I need a Perl ... You wrote "I'm working os a script ...", so you must at least have something to start with. ... Eeven if you post a rudimentary program that shows that you at least tried to do some work yourself, you'll find legions of people willing to help. ...
    (comp.lang.perl.misc)
  • Re: DBD-Oracle-1.14 and Oracle 9i
    ... I have written a shell script which compiles & installs perl from source using ... Solaris 9 because I wanted to customize some other things. ...
    (perl.dbi.users)
  • 2005-11-20 [de.comp.lang.perl.cgi] FAQ
    ... Programmiersprache Perl in CGI-Scripten. ... Wo gibt es Dokumentation über Perl und CGI? ... Hilfe zum Programm perldoc kann man mit 'perldoc perldoc' ... Mein Script läuft nicht bei meinem Provider. ...
    (de.comp.lang.perl.cgi)
  • 2005-11-20 [de.comp.lang.perl.cgi] FAQ
    ... Programmiersprache Perl in CGI-Scripten. ... Wo gibt es Dokumentation über Perl und CGI? ... Hilfe zum Programm perldoc kann man mit 'perldoc perldoc' ... Mein Script läuft nicht bei meinem Provider. ...
    (de.comp.lang.perl.cgi)
  • 2005-11-20 [de.comp.lang.perl.cgi] FAQ
    ... Programmiersprache Perl in CGI-Scripten. ... Wo gibt es Dokumentation über Perl und CGI? ... Hilfe zum Programm perldoc kann man mit 'perldoc perldoc' ... Mein Script läuft nicht bei meinem Provider. ...
    (de.comp.lang.perl.cgi)