in reply to Re: How to grep for a filename for each of the keys of a hash
in thread How to grep for a filename for each of the keys of a hash
As per above comments you use the quotemeta function.
And
Insist of the below code
grep (/$filename/i, $key) foreach my $key (keys %path_versions)
You will try the below code. Here, you no need to use the foreach loop. You directly pass 'hash keys'.
@array = grep (/$filename/, keys %path_versions);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: How to grep for a filename for each of the keys of a hash
by perl_mystery (Beadle) on Dec 13, 2010 at 06:11 UTC | |
by k_manimuthu (Monk) on Dec 13, 2010 at 06:34 UTC | |
by Anonymous Monk on Dec 13, 2010 at 06:35 UTC |
In Section
Seekers of Perl Wisdom