in reply to How to hash without the hash- basic
use Data::Dumper; my @array = qw(1 3 4 55 4 3 4 22 1 3 4 3 2 2 3 34); my @uniqs; foreach (@array) { ${"uniq_$_"} and next; ${"uniq_$_"} = 1; push @uniqs, $_; } print Dumper \@uniqs;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to hash without the hash- basic
by AnomalousMonk (Archbishop) on Oct 26, 2011 at 19:45 UTC |