in reply to Re^3: Duplicate lines with spaces, tabs...
in thread Duplicate lines with spaces, tabs...

I used:
$ perl -i.bak -lne 's/\A\s+//; s/\s+\Z//; next unless $_ and not $seen +{$_}++; print' input.txt
And I didn't get empty trailing lines...
[]s, HTH, Massa