1844011 Members
3456 Online
110226 Solutions
New Discussion

Re: mget using Perl

 
Kishore.R.P
Occasional Advisor

mget using Perl

all,
I want to copy a file with an extension .zip using FTP via Perl.
am using NET::FTP module but get() method does not seem to work if i need to copy a file with some extension..
Pls help out
4 REPLIES 4
Ollie Rowland
Frequent Advisor

Re: mget using Perl

Hi,

Can you give a sample of the perl script for further analysis?
H.Merijn Brand (procura
Honored Contributor

Re: mget using Perl

You mean something like this?

my $ext = "zip";
for ($ftp->ls) {
m/\.$ext$/i or next;
$ftp->get ($_);
}

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kishore.R.P
Occasional Advisor

Re: mget using Perl

i got it by using $ftp->ls(*.zip)
Thanks a lot..
H.Merijn Brand (procura
Honored Contributor

Re: mget using Perl

note that using $ftp->ls ("*.zip") (don't forget the quotes) is case sensitive, whereas my suggested solution will catch all .zip .Zip .ZIP .ziP .zIp etc

Enjoy, Have FUN! H.Merijn [ seeing no appreciations for the given comments ]
Enjoy, Have FUN! H.Merijn