ArifS has asked for the wisdom of the Perl Monks concerning the following question:
Print only uniq paragraphs-for my $list (@lists) { printGroups($list->{groups}, %group); print $list->{line}; print "\n"; }
But's it's not working and gives error- undefined value as an ARRAY.... Please let me know if you see anything lackingsub uniq { my %seen; grep !$seen{$_}++, @_; } for my $list (@lists) { my @filtered = uniq(@lists); printGroups($filtered->{groups}, %group); print $list->{line}; print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print Uniq
by choroba (Cardinal) on Jul 11, 2016 at 15:09 UTC | |
|
Re: Print Uniq
by haukex (Archbishop) on Jul 11, 2016 at 15:48 UTC | |
|
Re: Print Uniq
by GotToBTru (Prior) on Jul 11, 2016 at 16:58 UTC | |
|
Re: Print Uniq
by dorko (Prior) on Jul 11, 2016 at 18:21 UTC |