http://qs321.pair.com?node_id=981335


in reply to Uniq and sort in perl

Any time you need to get a unique list in Perl you should think of using a hash. Say you defined a hash called %seen outside the while loop and changed the print line to read...
print "$vm, $filer, \n" if ! $seen{"$vm:$filler"}++;
This will print the entry the first time and increment the seen flag for that pair, now subsequent identical results will encounter a set flag and not print as a result

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."