theleftsock has asked for the wisdom of the Perl Monks concerning the following question:
any suggestions would be good.
thanks -theleftsock
use warnings; use strict; my ($outer_hr_aref, $inner_hr_aref); foreach my $outer_href (@$outer_hr_aref) { foreach my $inner_href (@$inner_hr_aref) { if (($$outer_href{key1} eq $$inner_href{key2}) & ($$outer_href +{key3} == $$inner_href{key4})) { #abitrary key assignment could be ot +her combinations print "status found: $$inner_href matching $outer_href\n"; $$outer_href{key1} = 'something_new'; #arbitrary, other fu +nction calls can occur #somehow now remove the $inner_href item from the @$inner_ +hr_aref so i don't have to search the entire aref again. last; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Removing items from an Array Reference in Place
by tobyink (Canon) on Jan 09, 2013 at 16:52 UTC | |
by theleftsock (Beadle) on Jan 09, 2013 at 17:53 UTC |