daytripper1021 has asked for the wisdom of the Perl Monks concerning the following question:
I'm a newbie to perl and currently trying to convert an existing shell-script I made to perl.
I'm having problems converting the ftp part. The shell-script version is this:
YDAY=`TZ=TAIST+16 date '+%Y%m%d'`
/usr/bin/ftp -n 192.168.180.27 << EOF
user nped nped
bin
lcd /tmp/npdd/output
prompt
mget GOLD_SCH$YDAY.Z
close
EOF
I tried the Net::FTP::Recursive module but I'm having trouble with the rget command to use wildcards as above.
Here's what I tried doing (but failed, of course):
use Net::FTP::Recursive;
$ftp = Net::FTP::Recursive->new("192.168.118.58", Debug => 0);
$ftp->login("rbi",'rbi');
$ftp->cwd("/data/rbi/RBIPublic/combination/bak");
$ftp->rget( ParseSub => \&yoursub );
# $ftp->rget("evcREC$YDAY.*,/c0re/goldsch/input");
$ftp->quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::FTP::Recursive rget
by jethro (Monsignor) on Aug 12, 2008 at 10:59 UTC | |
|
Re: Net::FTP::Recursive rget
by dHarry (Abbot) on Aug 12, 2008 at 08:20 UTC | |
|
Re: Net::FTP::Recursive rget
by graq (Curate) on Aug 12, 2008 at 10:58 UTC | |
|
Re: Net::FTP::Recursive rget
by apl (Monsignor) on Aug 12, 2008 at 10:39 UTC |