Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Code + Results to HTML

by TheoPetersen (Priest)
on Feb 25, 2001 at 03:48 UTC ( #60693=note: print w/ replies, xml ) Need Help??


in reply to Code + Results to HTML

Since you are going to stuff the whole file into a scalar anyway, let Perl do that for you:

my $source; { open INPUT, $file; local $/ = undef; $source = <INPUT>; close INPUT; }
You caught the need to escape the tag characters in the code, but there are some cases that will slip through. CGI's escapeHTML function can filter the whole file at once; I'm sure there are other implementations too.


Comment on Re: Code + Results to HTML
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (17)
As of 2015-07-01 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (19 votes), past polls