You need to actually open the file for parsing.
#!/usr/bin/perl -w use strict; use warnings; my $folder= "oem"; my $file = "./oem.h"; open my $fh, $file or die $!; my @array = <$fh>; close $fh; my @content = grep {/\Q$folder\E/} @array; print "@content";
In reply to Re: Why is grep not searching for contents?
by wind
in thread Why is grep not searching for contents?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |