in reply to removal of dupes using a hash
...and here's one which removes the elements from the original array...$l=0; while($l<$#sorted) { push @data_out_ref, \$sorted[$l] if substr($sorted[$l],0,7) ne subs +tr($sorted[$l++ +1],0,7); } print "$$_\n" for @data_out_ref;
for($l=0; $l<$#sorted; $l++) { splice(@sorted, $l, 1) if substr($sorted[$l],0,7) eq substr($sorted[$ +l+1],0,7); }
|
|---|