Anyway, if your main worry is that Perl is doing interpolation, you could try to escape the $ and @ in the string
Though I have to admit I had problems with your full string so I shortened it...
This is only a stub, one would have probably also have to deal with already escaped $ and @ too.
use v5.12; use warnings; use Data::Dump qw/pp dd/; my $scl ="XXX"; my @arr = 1..3; # my $raw = <<'___'; # \r\n\t\tHello\tWorld\uFF00\\0\\n\\n\\!!\\"--->\\xf3\\"abc\\x4\\2\\8\ +\2 # ___ my $raw = <<'___'; \r\n\t\tHello\tWorld $scl@arr ___ chomp $raw; dd $raw; $raw =~ s/(\$|\@)/\\$1/g; my $str = eval qq("$raw"); dd $str; # probably better done with unpack printf "%02X ",ord($_) for split //,$str;
"\\r\\n\\t\\tHello\\tWorld\n\$scl\@arr" "\r\n\t\tHello\tWorld\n\$scl\@arr" 0D 0A 09 09 48 65 6C 6C 6F 09 57 6F 72 6C 64 0A 24 73 63 6C 40 61 72 7 +2
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
In reply to Re: C style strings
by LanX
in thread C style strings
by harangzsolt33
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |