Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: how to force HTML to display as text

by Chrisf (Friar)
on Jan 24, 2002 at 16:04 UTC ( #141194=note: print w/replies, xml ) Need Help??


in reply to how to force HTML to display as text

TAAFWWTDI - There's always a far worse way to do it...
#!/usr/bin/perl -wT use strict; print "Content-type: text/html\n\n"; print <<HEADER; <html> <head> <title>My HTML</title> </head> <body> <p>Here's the HTML:</p> <textarea cols="50" rows="20"> HEADER open HTML, "<data.html" or die "Can't open data.html: $!"; while (<HTML>) { print $_; } close HTML; print <<FOOTER; </textarea> </body> </html> FOOTER

That works in some browsers, doesn't work in others.

p.s. Make sure to follow grep's suggestion about code tags ;-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2022-01-17 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (51 votes). Check out past polls.

    Notices?