You may slap me for suggesting this (but please don't...I bruise easily), but you could try $con->dir("."). You'll need to extract the name as well as the first flag, but that shouldn't be too difficult. :)
Update: Ah, here you go. Just don't hurt me:
#!/usr/bin/perl -w use strict; use Net::FTP; # change preferences to meet your needs my $ftp_srv = 'ftp.ntua.gr'; my $ftp_usr = 'anonymous'; my $ftp_pass = 'me@somewhere.com'; my $ftp_path = '/pub/linux/slackware/slackware-9.0/'; # the main program my $con; $con = Net::FTP->new($ftp_srv, Debug => 1) or die "Unable to connect to $ftp_srv\n". $con->message ."\n"; $con->login($ftp_usr,$ftp_pass) or die "Cannot login: ". $con->message ."\n"; $con->cwd($ftp_path) or die "Cannot change to $ftp_path dir\n".$con->message ."\n"; my @ls = $con->dir('.') or die "Cannot perfom ls command\n".$con->message."\n"; my @readable = map printable_version($_), @ls; $\ = "\n"; print foreach @readable; sub printable_version { shift; /^(.).*\s([^\s]*)$/; "$1 $2"; }
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
In reply to Re: use (of) Net::FTP for updating
by antirice
in thread use (of) Net::FTP for updating
by atnonis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |