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


in reply to CPAN Module to determing overlap of 2 lists?

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11120564 use warnings; my $file1 = <<END; one two three four five six END my $file2 = <<END; two three four five six seven END my $marker = '***MARKER***'; # something not in either string my $combine = "$file1$marker$file2" =~ s/(.*)\K\Q$marker\E\1//sr; print $combine;

Outputs:

one two three four five six seven