# Find out where all you see hello word in files
use warnings;
use strict;
my @files = <*.*>;
foreach my $file(@files) {
if(-e -f $file) {
open my $file_handler, '<, $file;
while(<$file_handler>) {
if(/\A(hello)\z / ) {
print $1;
}
}
close $file_handle;
}
}
use warnings;
use strict;
my @files = <*.*>;
foreach my $file(@files) {
if(-e -f $file) {
open my $file_handler, '<, $file;
while(<$file_handler>) {
if(/\A(hello)\z / ) {
print $1;
}
}
close $file_handle;
}
}
No comments:
Post a Comment