http://qs1969.pair.com?node_id=703838

daytripper1021 has asked for the wisdom of the Perl Monks concerning the following question:

Hi there.

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;