Sunday, January 2, 2011

Extracting a value from multiple text files

use File::Slurp;
my %file_contents;my @files = glob(".stat_*");
foreach my $file (@files) {
    $file_contents{$file} = File::Slurp::read_file($file);
}ORsystem('grep YOUR_MATCHING_PATTERN YOUR_TARGET_FILES');

No comments: