in reply to removing duplicates lines plus strings from a file

remove duplicated lines

mmmh maybe like this... untested but you can try

use File::Copy; open my $file, '<' "myfile"; open my $file2 '>', "/path/to/mynewfile"; copy ($file, $file2); my $file2 =~ s/^([[:alnum:]]+)$\n{1}$1/$1/g;