> Bob Showalter wrote:
>
> > Johnson, Shaunn wrote:
> > > Howdy:
> > >
> > > I'm looking for information that will let me
> > > open an ftp connection and grep / search
> > > for files and then FTP them back to me.
> >
> > What do you mean "grep/search" for files? If you want to search for
> > particular file *names*, Net::FTP can return a list of files and
> > directories you can examine.
>
> True, but it is an inadequately documented feature of the
> module. The pod indicates only an optional DIR parameter for
> the ls function:
>
> ls ( [ DIR ] )
> Get a directory listing of "DIR", or the current directory.
>
> In an array context, returns a list of lines returned from the
> server. In a scalar context, returns a reference to a list.
>
> But the following:
>
> my @files = $ftp->ls("*.jpg");
Since there is noe directory '*.jpg' it just does the ls on the cwd.
So DIR is a directory, /images for instance
It looks like you are trying to ls jpg files but this isn't grep and the regex isn't
even right, it looks more like a winders type thing.
Try this:
my @jpgfiules = grep(/\.jpg$/, $ftp->ls("/images"));
# / is the directory you ftp into like /home/foo, so you do /images for the directory
/home/foo/images
> print "$_\n" foreach @files;
>
> does render:
Hmmm what is in the cwd if you ftp in via WS-FTP or somehting?
>
> Clouds.jpg
> DarkSky.jpg
> Davis Logo.jpg
> DavisLogo.jpg
>
> Joseph
HTH
DMuey
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]