Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Why is the below grep failing?It fails to search the contents of oem.h,what should I change to search for contents?
#!/usr/bin/perl -w use strict; use warnings; use File::Find; use File::Find; my $folder= "oem"; my @array="./oem.h"; my @content; @content = grep {/\Q$folder\E/} @array; print "@content";#prints ./oem.h instead of the matched content
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why is grep not searching for contents?
by wind (Priest) on Apr 30, 2011 at 03:09 UTC | |
by Anonymous Monk on Apr 30, 2011 at 03:27 UTC | |
by John M. Dlugosz (Monsignor) on Apr 30, 2011 at 10:15 UTC | |
by Anonymous Monk on Apr 30, 2011 at 04:18 UTC | |
|