Thanks everybody for there help, did a little more dinging and came up with:-

   eval {
     $ftp = Net::FTP->new( $remote_host ) or die "faild to connect to
$remote_host";
     $ftp->login( $remote_user, $remote_password ) or die "failed to
login $remote_user";
     $ftp->cwd( $remote_dir ) or die "fail to cwd to $remote_dir";
     my @f = $ftp->ls or die "failed to ls $remote_dir";
     foreach $file ( @f ) {
       if ( $file =~ /$flist/ ) {
         print LOGFILE "        Getting $file";
         $ftp->get( $file, $local_dir  ) or die "failed to get $file";
       } else {
         print LOGFILE "        Skipping $file";
       }
     }
     $ftp->quit;
   };

   if ($@) {
     print LOGFILE "Error:[EMAIL PROTECTED]";
     return(1);
   }

Witch almost works.  The problem is:-

if ( $file =~ /$flist/ ) {

Which gived the error:-

Error:Quantifier follows nothing in regex; marked by <-- HERE in m/*
<-- HERE .csv/ at ./subs2pubsub_cron.pl line 786.

The variable $flist has something like '*.cvs' in it which I guess is
almost but not quite a regular expresion.

Any idea how I can find out if $file matches the filename 'mask'
$flist.  Alternatively is there a way of doing a ls and specifying a
file mask?

Ben
--
Ben Edwards - Bristol, UK
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to