ragilla has asked for the wisdom of the Perl Monks concerning the following question:
@array1 = ( { 'url' => [ 'wp-content/uploads/2012/04/HB-177-Veto-Letter.pdf' ], 'bill' => [ 'CS3', 'HB', '177', 'Inmate Reentry', 'Porth', '3/9/12', '3/30/12', 'VETO' ] }, { 'url' => [ 'uploads/2012/03/3.29.12-Transmittal-Letter-3.pdf' ], 'bill' => [ 'CS1', 'HB', '697', ' School Board of Sumter County', 'McBurney', '3/9/12', '3/16/12', 'VETO' ] }, { 'url' => [ 'tent/uploads/2012/04/HB-865-Veto-Letter.pdf' ], 'bill' => [ '', 'HB', '865', 'Pinellas Suncoast Transit Authority, Pinellas County', 'Hooper', '3/9/12', '3/30/12', 'VETO' ] }, { 'url' => [ 't/uploads/2012/04/4.13.12-HB-917-Veto-Letter.pdf' ], 'bill' => [ '', 'HB', '917', 'Jurisdiction of the Courts', 'Bileca', '3/7/12', '3/30/12', 'VETO' ] }, { 'url' => [ 's/2012/04/HB-1117-Veto-Letter.pdf' ], 'bill' => [ 'CS1', 'HB', '1117', 'Conservation of Wildlife', 'Harrison', '3/9/12', '3/30/12', 'VETO' ] } );
Now from the above array i want to grep for 1117 which should be value of key 'bill' of the different hashes.. i can do that using for loop, but i hope there would be some one liner to grep all those hashes into an array whose 'bill' key value contains 1117..
so please help me here ...
thanks in Advance
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl array of hashes help
by trizen (Hermit) on Apr 30, 2012 at 13:04 UTC | |
by Anonymous Monk on May 02, 2012 at 05:24 UTC | |
by trizen (Hermit) on May 02, 2012 at 12:20 UTC | |
by ragilla (Novice) on May 07, 2013 at 04:20 UTC | |
by trizen (Hermit) on May 07, 2013 at 22:41 UTC | |
Re: perl array of hashes help
by mrguy123 (Hermit) on Apr 30, 2012 at 13:05 UTC | |
by roboticus (Chancellor) on Apr 30, 2012 at 13:19 UTC | |
by mrguy123 (Hermit) on Apr 30, 2012 at 13:25 UTC | |
Re: perl array of hashes help
by Anonymous Monk on Apr 30, 2012 at 20:15 UTC |