in reply to Re: Re: slurping into a substring'ed' array
in thread slurping into a substring'ed' array
thanks for your fast responses, i was in the proces of testing it myself, and had got as far as:
my %seen; my @sorted = sort($a <=> $b) grep{ $seen{$_}++ } map {substr($_,0,1)} +@original_array;
when i realised y'all were on the board already!!
I just wanted to point out that my code above printed out this list:
A,A,B,B,C
So why did it only print out the extra As and Bs? Out of curiosity.
Thanks again for your help.
Sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: slurping into a substring'ed' array
by dragonchild (Archbishop) on Apr 26, 2004 at 15:31 UTC |