On 2019-12-03 17:31, Paul Procacci wrote:
When a string is specified in single quotes, perl6 (or any other language that I'm aware of) will not evaluate or interpret an escape character EXCEPT when the escape is follow'd by a single quote (') or backslash(\).
These HAVE to be escaped and the interpreter HAS to account for it.

Hi Paul,

I am not finding that to be the case.  Well maybe not Perl 5.

$ bash -c "echo '\'"
\

$ echo '\\\'
\\\

$ echo '\\'
\\

$ echo '\'
\


  If it is on purpose and not a "feature" in Perl 6, then
the documentation should state that single quotes will
have interpretations inside of them in certain cases.


Ahh Perl 5 is a pain in the butt backslash wise!

$ perl -e "CORE::say '\\\\';"
\

And I am seeing in
https://docs.perl6.org/language/quoting
     Literal strings: Q
     Q[A literal string]

Is the way I have been using single quotes.

So the rule is single quotes are literal, unless a backslash
in included, then use Q

Thank you for the help!

-T

Reply via email to