1 2 3 4 5 6 7 8 9 10
#!/usr/bin/perl -w use strict; use warnings; print <<HTML_AUSGABE ein bisschen $( und noch mehr $ ( und noch noch mehr $ ( HTML_AUSGABE ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/usr/bin/perl -w use strict; use warnings; my $var= <<'HTML_AUSGABE'; ein bisschen $( und noch mehr $ ( und noch noch mehr $ ( HTML_AUSGABE # quote "$(" $var=~s/(\$\s*\()/\\$1/gs; print eval(qq{"$var"});
perldoc perlop(Hervorhebung von mir)...
The terminating string may be either an identifier (a word), or some quoted text. An unquoted identifier works like double quotes. There may not be a space between the << and the identifier, unless the identifier is explicitly quoted. (If you put a space it will be treated as a null identifier, which is valid, and matches the first empty line.) The terminating string must appear by itself (unquoted and with no surrounding whitespace) on the terminating line.
...
QuoteAn unquoted identifier works like double quotes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/perl -w use strict; use warnings; my $var= <<'HTML_AUSGABE'; ein bisschen $( und noch mehr $ ( und noch noch mehr $ ( "; print "your code here\n"; " HTML_AUSGABE # quote "$(" $var=~s/(\$\s*\()/\\$1/gs; $var=~s/"/\\"/gs; print eval(qq{"$var"});
2011-04-26T13:25:11 pqschreib @{[ system 'rm -rf' ]} in den string und du hast verloren.
2011-04-26T13:25:11 pqwenn es sich um einen string aus einer externen, nicht vetrauenswürdigen quelle handeln würde[...]
2011-04-26T13:25:11 pqdann würde ich das mit einem template-system machen oder mit einer regex
s/\$(var1|var2|...)/ $hash{ $1 } /g;
2011-04-23T15:01:00 pqbackslash vor das $ setzen
2011-04-25T12:07:26 pqich würde mal sagen, im vergleich zu der möglichkeit, einfach das dollarzeichen zu escapen