Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Re: breaking a line on printing

by mt2k (Hermit)
on Mar 19, 2002 at 14:25 UTC ( [id://152730]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: breaking a line on printing
in thread breaking a line on printing

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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://152730]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-16 14:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found