# @words is the list of words (composed of letters and numbers only, no punctuation) my($self) = @_; foreach $r (@words) { $r{lc $r} = 1; } @words = sort keys %r; #### # @seen is (I think) a pseudo-hash of common words @common = qw(a and at); # bigger in real life @seen{@common} = (); foreach $item (@words) { push(@only,$item) unless exists $seen{$item}; } @words = @only;