in reply to finding unique items in an array, from a text file

By the way,

my %seen; my @uniq; foreach my $item (@lines) { unless ($seen{$item}) { #if we get here, we have not seen it before $seen{$item} = 1; push(@uniq, $item); } }

can be written as

my %seen; my @uniq = grep !$seen{$_}++, @lines;