I have a utility function I often use for this sort of thing. See Below:
my(@numbers) = <DATA>; chomp @number; print join("\n", uniqStrings(@numbers)); sub uniqStrings { my %temp = (); @temp{@_} = (); return keys %temp; } __DATA__ 1236 3232 1236 4323 4323
That will actually run a little faster because the method used to remove duplicate numbers is pretty well optimized. Hope that helps.
In reply to Re^2: Getting rid of duplicates
by JediWizard
in thread Getting rid of duplicates
by New Novice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |