in reply to Re^9: Remove redundency from an array
in thread Remove redundency from an array
use Test::More tests => 2; sub uinq { @_ = do { @$_{@_}=(); keys %$_ }; @_ } my @array = (1,1,3,3,2,3,5,7,5,2); %$_ = ( f=>'oo', b=>'ar' ); is keys(%$_), 2; print "@{[ uinq @array ]}\n"; is keys(%$_), 2;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: Remove redundency from an array
by mwah (Hermit) on Sep 24, 2007 at 21:05 UTC | |
by ikegami (Patriarch) on Sep 24, 2007 at 21:47 UTC | |
by mwah (Hermit) on Sep 25, 2007 at 06:36 UTC |