Probably not the best WTDI if any of the files are quite large.sub fgrep_dash_l { my $search = shift; local $/ = $search; my @files; while (my $file = glob("*")) { open my $fh, "<", $file or warn "error opening $file: $!" and ne +xt; defined(my $buffer = <$fh>) or next; push @files, $file if substr($buffer, -length($search)) eq $sear +ch; } return @files; } @arr = fgrep_dash_l("<value>IsFrequentlyUsed</value>");
In reply to Re: Alternative to using system grep
by ysth
in thread Alternative to using system grep
by Ananda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |