S E wrote: > Hello! > > I have been working on familiarizing myself with the File::Find > module. We have a process that appends a .txt once it has processed > the file in a Unix environment. So, I wanted to return a list of > files that have been processed by the previous process. I have been > using the below to achieve that. > > Here is my question which I have been having problems with. I want > to create a list of the files that have not been processed. But, due > to the naming conventions (or lack of) the only way to find those > find the files that have not been processed is to look for files > without a .txt in the file name. Is there a modification that I can > make to the below to achieve that? > > Thanks, > S > > -- > > #!/usr/bin/perl > use warnings; > use strict; > use File::Find; my @MyUnProcssed = ();
> find (\&match_pattern, "/home/user/prod" ); > sub match_pattern { > print "$File::Find::name\n" if ( m/txt/ ); if ( m/\.txt$/ ) { # so if you have file txt1 it will not find it, but does find txt1.txt print "$File::Find::name\n" }else { push(@MyUnProcessed, $File::Find::name); } One way. Wags ;) > } > > > -- ******************************************************* This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. ******************************************************* -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>