Thanks to all for their suggestions.  I'd rather use an existing function
than something I wrote.

Is File::Slurp the best option for appending files ??.  How will it work
with large files, it that a machine memory limitation since it needs the
file to be in @array? Or does @r = <F> cache to disk if a memory limitation
is reached ??


Thanks to all for their suggestions & Happy New Year.

Scott

BTW here is what I came up yesterday, that I will replace with "glob".

sub CheckForFiles {

my $filena;
my $ldir;
my $ext;

($filena,$ldir,$ext) = fileparse($orig,'\..*');

#
# see what we have
#
print "\n filena = $filena";
print "\n dir = $ldir ";
print "\n ext = $ext";

$x = opendir THISDIR, "$ldir";
if ( $x) {

     @filelist = grep !/^\.\.?$/, readdir THISDIR;
     #
     # create the regex on the fly
     #
     $filena =~ s!\*!\.\*!g;
     $filena = "^" . $filena;
     $ext =~ s!\.!\\.!;
     $ext =~ s!\*!\.\*!;
     $regex = "$filena$ext";
     print "\n regex is $regex";

     foreach $fi (@filelist) {
          if ($fi =~ /$regex/) {
               print "\n$fi";
               push @movelist,$fi
          }
     }
     $rv = @filelist;
} else {
     print "\n Directory failure";
     print "\n \$! = $!";
     $rv = 0;
}
     return $rv;

}

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to