Re: Net::FTP
From: Paul Lalli (mritty_at_gmail.com)
Date: 03/22/05
- Next message: Tim Hammerquist: "Re: @ARGV not getting command line arguments"
- Previous message: Trey Waters: "Re: Need help getting start with a test cgi script."
- In reply to: lucas: "Net::FTP"
- Next in thread: lucas: "Re: Net::FTP"
- Reply: lucas: "Re: Net::FTP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Tim Hammerquist: "Re: @ARGV not getting command line arguments"
- Previous message: Trey Waters: "Re: Need help getting start with a test cgi script."
- In reply to: lucas: "Net::FTP"
- Next in thread: lucas: "Re: Net::FTP"
- Reply: lucas: "Re: Net::FTP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|