http://www.perlmonks.org?node_id=11108019

GHMON has asked for the wisdom of the Perl Monks concerning the following question:

Hi

i want to make loop for a directory for process all files but in that directory always another processor write new file so i don't want to process all file again

i put my code

foreach my $file ( glob('/root/fd/fg/*.txt') ) { open (MYFILE, "<$file") or die $! ; my $ad ; my @rt ; while (<MYFILE>){ if ($_ =~ m/ad/) { ($_ =~ tr/a-z,=//d ) ; $ad = $_ ; } if ($_ =~ m/rt /){ ($_ =~ tr/a-z,=//d) ; push (@rt , $_); } } }