Hi,
First of all it will make it easier to understand your question if you put the code in code tags like below:
@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-Transmi +ttal-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', 'Hoope +r', '3/9/12', '3/30/12', 'VETO' }, { 'url' => 't/uploads/2012/04/4.13 +.12-HB-917-Veto-Letter.pdf' , 'bill' => '', 'HB', '917', 'Jurisdictio +n 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' +} );
Writeup Formatting Tips can also help you in your next posts :)
To answer your question, I'm assuming there are also other solutions, but doing a loop is a very easy and simple solution that you should take into account:
for my $line_hash (@array1){ if ($line_hash->{'bill'} =~ /1117/){ print "Found a match"; } }
Hope this helps
Mister Guy

In reply to Re: perl array of hashes help by mrguy123
in thread perl array of hashes help by ragilla

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.