in reply to Print Uniq

You apply your uniq function when your for loop already is working on the array containing duplicates.

sub uniq { my %seen; grep !$seen{$_}++, @_; } my @filtered = uniq(@lists); for my $list (@filtered) { printGroups($list->{groups}, %group); print $list->{line}; print "\n"; }

This makes a little more sense, but your uniq function is not doing what you think. It would work if @lists contained scalars, but it doesn't. You need to modify the hash key to produce a scalar value. This will be determined by what constitutes a duplicate. Is it the lines are the same? Or is it based on how many values are in groups? Or what values are in groups? If the first, you want $_->{line} instead of $_.

But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)