good morning. I am working with an array reference of hash references. i am looking to match a particular set of keys, but I am returning a subset of that array ref hash refs and searching that array for the full combination of keys. then I set the $inn_href undef and grep over the original aref to remove any found sets of keys reducing the search size. The problem is that the array returned by grep are not references to $aref_hrefs_inn, so $aref_hrefs_inn is not reduced. Does anyone know how I can get the references correctly in my search array so that when i set it to undef i set the original array refs values to undefined?

Update: Just for some clarity, $aref_hrefs_inn is an array reference of hash references. I want to find a subset of that array, looking for one particular key->value pair of which there are multiple in the array reference. from there I want to loop through this subset to match other keys. I want to modify my large array reference of hash references in place by removing any rows that I found. My apologies if the codes isn't clear as code is sort of long, and I posted this example quickly. Ill try to come up with a functioning example easily.

thanks -theleftsock

@$search_array = grep{$_->{key_inn} eq $$out_href{key_search}} @$aref_ +hrefs_inn; foreach my $inn_href (@$search_array) { if (check_match($args_href) == 1) { if ($$flags_href{unique} == 1) { $inn_href = undef; } last; } } @$aref_hrefs_inn = grep {$_} @$aref_hrefs_inn;

In reply to grep return a set of references by theleftsock

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.