I'm not sure if it is an issue with the Perl version (I am using 5.16.3 and 5.22), but rather with line endings on Windows. I don't use Windows myself, but there are considerations with line-endings on that platform; do a search and you'll find at least a couple of discussions about the topic in the last couple of months.
What happens if you change the key line to:
?$txt =~ s/\r\n\|/ /g;
In reply to Re^5: Substitution in range operator
by 1nickt
in thread Substitution in range operator
by benaw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |