in reply to All the other Characters
Now all you have to worry about is a line in the text matching the here-doc terminator. Here's a way to avoid that problem, in the script that creates the code:print <<'EndOfText'; Hello! my name is "Bob". This is an old\new text. EndOfText
With a null terminator, a here-doc ends at the first empty line; the substitution replaces all the empty lines in the user's input with lines containing a single space.$str = 'user input'; $str =~ s/^$/ /gm; # add a space to each blank line print <<"EndOfGeneratedCode"; print <<''; $str EndOfGeneratedCode
|
|---|