kmxillo has asked for the wisdom of the Perl Monks concerning the following question:
I have two arrays of hashes (@r_objects and @r_objects). A want to find the value in @A that differs from @B. Using grep function with the condition 'eq' works fine. My problem is when I use 'ne', it shows all $_obj_prevVal from @prev_values. Here is my code.
Does anyone can help me? Thank youmy @_remainObj = map { my $_obj_prevVal = $_->{OBJECT}; my $_mnum_prevVal = $_->{METRIC}; my $_notObj_rObjects = grep { $_obj_prevVal ne $_->{OBJECT} and +$_mnum_prevVal eq "1"} @r_objects; $_notObj_rObjects ? $_obj_prevVal : (); } @prev_values;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Strange bevahiour of grep function.
by LanX (Saint) on May 14, 2013 at 15:57 UTC | |
Re: Strange bevahiour of grep function.
by RichardK (Parson) on May 14, 2013 at 16:55 UTC |
Back to
Seekers of Perl Wisdom