in reply to perl fool - inserting text into html doc
Instead of template =~ s/TEXTGOESHERE/$textfile/se try $template =~ s/TEXTGOESHERE/$textfile/g; The /s modifier that you're using says to that a . in a regular expression should match a newline. Since you don't have a . in your regular expression, this is a no-op.
The /e modifier says to treat the replacement string as a Perl expression, and to use that value of that expression when making the replacement. This is almost certainly not what you intend.
By using /g instead, you're saying to replace every occurance of TEXTGOESHERE with the contents of $textfile. If you have only one TEXTGOESHERE, you'll only get one substitution.
Try it.
|
|---|