Saturday, 15 August 2015

perl Net::FTP ls no matches -



perl Net::FTP ls no matches -

my $u = uri->new('ftp://myuri'); $ftp = net::ftp->new($u->host(), debug => 1) or die "connection failed!"; $ftp->login($u->user(), $u->password()) or die "login failed!"; $ftp->cwd($u->path()) or die "cwd failed!"; $ftp->binary(); @ls = $ftp->ls('s*.txt') or die "list failed!" . $ftp->code(); foreach $line (@ls) { print "### $line\n"; }

this code die bacause ls has not matches, possile determine if ls() successful no matches or there other error?

net::ftp derived net::cmd, should documentation of net::cmd too. there can see, $ftp->ok can used check if lastly command ok if returned no data.

perl

No comments:

Post a Comment