Perl/Shell Knowledge Sharing
Perl Interview Questions and Answers
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:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment