Just another Perl shrine | |
PerlMonks |
Re: Can't get \n or other character/translation escapes to interpolate if originally read from a data fileby pryrt (Abbot) |
on Mar 15, 2021 at 17:23 UTC ( [id://11129683]=note: print w/replies, xml ) | Need Help?? |
++AnomalousMonk explained the "why". Here's something you can do to get the string in the format I think you want: the String::Interpolate module allows you to pass a string with character escapes and get back the string that I believe you desire.
yields
note: I've never used it before today; I found it via a quick search, and its description and above behavior seemed right. Also, I don't have the Programming Perl to check page numbers, but "translation escapes" sound like escapes that are only available to the regex substitution engine and not to normal strings, so those will likely not be available even in String::Interpolate (unchecked).
In Section
Seekers of Perl Wisdom
|
|