home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
perl_ste.zip
/
auto
/
Net
/
FTP
/
_list_cmd.al
< prev
next >
Wrap
Text File
|
1997-11-28
|
607b
|
37 lines
# NOTE: Derived from ./blib/lib/Net/FTP.pm. Changes made here will be lost.
package Net::FTP;
sub _list_cmd
{
my $ftp = shift;
my $cmd = uc shift;
delete ${*$ftp}{'net_ftp_port'};
delete ${*$ftp}{'net_ftp_pasv'};
my $data = $ftp->_data_cmd($cmd,@_);
return undef
unless(defined $data);
require Net::FTP::A;
bless $data, "Net::FTP::A"; # Force ASCII mode
my $databuf = '';
my $buf = '';
while($data->read($databuf,1024))
{
$buf .= $databuf;
}
my $list = [ split(/\n/,$buf) ];
$data->close();
wantarray ? @{$list}
: $list;
}
1;