c:\@Work\Perl>perl -wMstrict -le "my $str1 = qq(|L|D|); my $str2 = qr(\|L\|); print qq{stringization of qr// output: '$str2'}; if ($str2 =~ $str1) { print 'foo'; } " stringization of qr// output: '(?^:\|L\|)' foo c:\@Work\Perl>perl -wMstrict -le "my $str1 = qq(|X|Y|); my $str2 = qr(\|L\|); if ($str2 =~ $str1) { print 'foo'; } " foo c:\@Work\Perl>perl -wMstrict -le "my $str1 = qq(|X|Y|); my $str2 = qq(aaaaa); if ($str2 =~ $str1) { print 'foo'; } " foo