Welcome to using Perl! Here is a basic example of using the Net::FTP module getting a list of files (in the example, they are .xml files). The program logs in, changes to a directory called bulk_download, gets the list of files, and then ftps them. At the end, it says how many files were fetched. Hope this helps!
#!/usr/bin/perl -w use Net::FTP; # use the ftp module use strict; my (@filelist, $file, $ftp, $ftp_count); my $host = 'your ip address'; my $user = 'username'; # user name for login my $pass = 'password'; # password for login $ftp_count = 0; $ftp = Net::FTP->new($host, Debug => 0); # start an FTP session $ftp->login($user,$pass); # login $ftp->cwd("bulk_download"); # go to the bulk_dowload +directory $ftp->binary; # make sure we ftp the fi +le as binary @filelist = $ftp->ls("*.xml"); # and get the list of .xm +l files foreach $file (@filelist){ $ftp->get($file); # fetch it, ++$ftp_count; } $ftp->quit; print "For $host found $ftp_count files\n";

In reply to Re: connecting to ftp sites and download certain files based on file extensions by odha57
in thread connecting to ftp sites and download certain files based on file extensions by Anonymous Monk

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.