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;


In reply to Net::FTP::Recursive rget by daytripper1021

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.