in reply to Wrestling with HoL

Well, references can get very confusing. If you copy a reference, you only copy the pointer. If you want to change the data with a copied pointer, you change the original data. You could peek at perlref, perldsc, perllol and perlreftut.

Having said this, your code can be cleaned up using grep.

@$row_data{groups} = grep{ $_->{whatever} == $foo } @$row_data{groups} + ;
To do groups and fields in one sweep:
for( qw/groups fields/ ){ my $aref = $row_data{$_}; @$aref = grep{ $_->{whatever} == $foo } @$aref; }
Which assigns the new arrays belonging to groups, fields with the filtered original arrays.

Hope this helps,

Jeroen
"We are not alone"(FZ)