tcf03 has asked for the wisdom of the Perl Monks concerning the following question:
if I pull ou the unless statement -it all works fine - I just end up with duplicate data in my array. Can anyone suggest how to skip the duplicates? Ive tried several different bits of code:push ( @{$map{$$row[1]}{$$row[2]}}, $$row[0] ) unless $map{$$row[1]}{$ +$row[2]}{$$row[0]}++;
etc... and none seem to work.push ( @{$map{$$row[1]}{$$row[2]}}, $$row[0] ) unless ${$map{$$row[1]} +{$$row[2]}{$$row[0]}}++;
push ( @{$map{$$row[1]}{$$row[2]}}, $$row[0] ) unless grep { /$$row[0] +/ } @{$map{$$row[1]}{$$row[2]}};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pulling duplicate data from a complex structure
by injunjoel (Priest) on Jan 23, 2006 at 18:42 UTC | |
|
Re: pulling duplicate data from a complex structure
by Fletch (Bishop) on Jan 23, 2006 at 18:44 UTC | |
|
Re: pulling duplicate data from a complex structure
by planetscape (Chancellor) on Jan 24, 2006 at 06:23 UTC | |
|
Re: pulling duplicate data from a complex structure
by NiJo (Friar) on Jan 23, 2006 at 18:44 UTC |