in reply to use (of) Net::FTP for updating
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: use (of) Net::FTP for updating
by atnonis (Monk) on Jun 26, 2003 at 02:05 UTC | |
|
Re: Re: use (of) Net::FTP for updating
by atnonis (Monk) on Jun 26, 2003 at 02:58 UTC | |
by antirice (Priest) on Jun 26, 2003 at 04:07 UTC | |
by LazerRed (Pilgrim) on Jun 27, 2003 at 16:44 UTC |