B
Bob
running on w2k pro sp2 system. Code is:
# ftptst.plx - 10 July 2003. testing ftp script
use warnings;
use strict;
use Net::FTP;
my ($hostname, $username, $password, $directory, $filename, $ftpobj, @last);
#declaration of parameters
$hostname="ftp.nowhere.com";
$username="anonymous";
$password="tst\@tsthere";
$directory="/pub";
$filename="*.txt";
$ftpobj = Net::FTP -> new ($hostname);
$ftpobj -> login($username, $password);
$ftpobj -> cwd ($directory);
@last = ftp->ls($filename) or die "No $filename found.\n";
$ftpobj -> quit;
-------------------- end of code ---------------------------
The above code works - the error is with the line requesting ls
@last = ftp->ls($filename) or die "No $filename found.\n";
the error reported is:
D:\perl\srccode\ftp>perl ftptst.plx
Can't locate object method "ls" via package "ftp" (perhaps you forgot to
load "ftp"?) at ftptst.plx line 25.
Questions:
1. Doesnt the line -- use NET::FTP -- load "ftp" ???
2. Is there a source for examples of using net::ftp?
thanks
r
# ftptst.plx - 10 July 2003. testing ftp script
use warnings;
use strict;
use Net::FTP;
my ($hostname, $username, $password, $directory, $filename, $ftpobj, @last);
#declaration of parameters
$hostname="ftp.nowhere.com";
$username="anonymous";
$password="tst\@tsthere";
$directory="/pub";
$filename="*.txt";
$ftpobj = Net::FTP -> new ($hostname);
$ftpobj -> login($username, $password);
$ftpobj -> cwd ($directory);
@last = ftp->ls($filename) or die "No $filename found.\n";
$ftpobj -> quit;
-------------------- end of code ---------------------------
The above code works - the error is with the line requesting ls
@last = ftp->ls($filename) or die "No $filename found.\n";
the error reported is:
D:\perl\srccode\ftp>perl ftptst.plx
Can't locate object method "ls" via package "ftp" (perhaps you forgot to
load "ftp"?) at ftptst.plx line 25.
Questions:
1. Doesnt the line -- use NET::FTP -- load "ftp" ???
2. Is there a source for examples of using net::ftp?
thanks
r