sachinmkulkarni has asked for the wisdom of the Perl Monks concerning the following question:
I need to get an output list, @l, which consists of all the values corresponding to the key 'a' only if the value for the key 'b' is y.
My output list @l = x1, x3 ; How do I achieve this using perl maps?For example: $ms[0] = \%m1 ( a => 'x1', b => 'y', c => 'z1' ); $ms[1] = \%m2 ( a => 'x2', b => 'y1', c => 'z2' ); $ms[2] = \%m3 ( a => 'x3', b => 'y', c => 'z3' ); $ms[3] = \%m4 ( a => 'x4', b => 'y2', c => 'z4' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question related to map
by almut (Canon) on Jun 24, 2010 at 20:17 UTC | |
|
Re: Question related to map
by Fletch (Bishop) on Jun 24, 2010 at 20:17 UTC | |
|
Re: Question related to map
by kennethk (Abbot) on Jun 24, 2010 at 20:18 UTC | |
|
Re: Question related to map
by planetscape (Chancellor) on Jun 25, 2010 at 01:13 UTC |