in reply to finding and deleting repeated lines in a file

If it's huge, best not to touch Perl, and simply use sort:
sort -o thefile -u thefile

-- Randal L. Schwartz, Perl hacker