in reply to print a hash
my %seen; while (<DATA>) { print "$1\n" if /(\d+)$/ and not $seen{$1}++; } __DATA__ foo 1 foo 2 bar 1 bar 3 bar 4 bar 2 bar 2 bar 1 baz 1 ex 5 [download]