a backtick?? Oh no! I hate ticks, burn it off, burn it off!!
And as for webadept's answer, that is also one of my favorites. I generally use something like

#!/usr/bin/perl -w use strict; print qq|Content-type: text/html\n <html> <head> <title>Yeah Yeah</title> </head> <!-- More HTML stuff here, etc... --> Oh looky here, a whatever this character is called \| |;

As long as you backslash any |'s in the text you'll be fine (and I don't think your output contains many if any of these...)

If you are outputting strings that contain a lot of strange characters, I'd definitely suggest use heredocs, especially if you are outputting very long HTML documents. For example:

print <<'YayIAmDone'; look at this text. lots of non-alphanumeric characters in this print s +tatement! 8)^404`76`5`65^%!^%^@éA¿º¿ªÑñç¦ and we don't even have to l +ook for anything to backslash! !$#!#!1~!````~!~!~21&$3(&6(*7_*(+|}|]{ +]{]":':?,,?< YayIAmDone exit;

In reply to Re: Re: Re: breaking a line on printing by mt2k
in thread breaking a line on printing by hotshot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.