gag has asked for the wisdom of the Perl Monks concerning the following question:

I am writing a script to make multiple HTML files. Its mostly the same code so I'm using a print to End of Text method. Unfortunately the HTML contains a % character which is interepreted as a hash, I believe, but \% is not escaping it as hoped.
An example portion of the code looks like this:
printf TEMP <<"_ENDOFTEXT_"; #other stuff <TABLE HEIGHT="100\%" CELLSPACING="0" CELLPADDING="0" WIDTH="100\%" BO +RDER="0"> #more stuff _ENDOFTEXT_
When compiled, it reports:
Invalid conversion in printf: "%"" at...
Am I doing something frightfully stupid?

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How do I print a % (percentage sign)?
by KM (Priest) on Dec 06, 2000 at 18:52 UTC
      I have, thank you, but now i'm ashamed to admit that my fault is not in the escaping, rather it is in using a printf statement instead of just plain old print.
      This isn't even a question about regular expressions. Thanks for helping though.
Re: How do I print a % (percentage sign)?
by vroom (His Eminence) on Dec 06, 2000 at 11:09 UTC
    blah

    Originally posted as a Categorized Answer.