iphone has asked for the wisdom of the Perl Monks concerning the following question:
I have an array "@files" which contain all the lines in a file.Some of the contents of the array ends with .plf like
//source/embark/load.c //deploy//common.c //depot/scripts/files/loading.plf
....Now I have the below hash "Hash_filematches",I want to execute the loop for only the keys (btw,keys in this hash only contain filenames with .plf extension)*not* in the array @files.How to i write this condition?
for my $key (keys %Hash_filematches) { if ($key !=~ /grep (/$key/i, @files/) {#grepping for the key value + and if it's not in the array then only proceed } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grep fail condition
by ELISHEVA (Prior) on Nov 07, 2010 at 22:00 UTC | |
by chromatic (Archbishop) on Nov 08, 2010 at 16:57 UTC | |
|
Re: Grep fail condition
by ikegami (Patriarch) on Nov 07, 2010 at 20:47 UTC | |
by iphone (Beadle) on Nov 07, 2010 at 21:09 UTC | |
by Anonymous Monk on Nov 07, 2010 at 21:12 UTC | |
by iphone (Beadle) on Nov 07, 2010 at 21:42 UTC | |
by ikegami (Patriarch) on Nov 07, 2010 at 22:11 UTC | |
|
Re: Grep fail condition
by aquarium (Curate) on Nov 07, 2010 at 22:24 UTC | |
|
Re: Grep fail condition
by Anonymous Monk on Nov 07, 2010 at 20:29 UTC |