Code:
$x = '\n'; print "var :==$x==\n"; print "eval :==", eval( qq{ sprintf "%s","$x" } ), "==\n";
Output:
var :==\n== eval :== ==
You need double-quotish interpolation *twice*. :)
In reply to Re: Substituting literal strings for escape characters by Anonymous Monk
in thread Substituting literal strings for escape characters by Tanalis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |