S E wrote:
Hello!
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?
--
#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
find (\&match_pattern, "/home/user/prod" );
sub match_pattern {
print "$File::Find::name\n" if ( m/txt/ );
}
#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
my ( @processed, @not_processed );
find( sub {
push @{ /\.txt$/ ? [EMAIL PROTECTED] : [EMAIL PROTECTED] },
$File::Find::name;
}, '/home/user/prod' );
print map "$_\n", @processed;
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>