Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: [ASCII 2 HTML] Appearently unable to find simple module!

by Corion (Patriarch)
on Nov 30, 2008 at 13:21 UTC ( [id://726898]=note: print w/replies, xml ) Need Help??


in reply to [ASCII 2 HTML] Appearently unable to find simple module!

I'm not sure if it does what you mean, but shouldn't the following do what you need?

use HTML::Entities; my $ascii = <<'ASCII'; The quick brown fox jumps over the lazy god. ASCII; my $html = encode_entities($ascii); $html =~ s/\r?\n/<br>/g; print "<pre>$html</pre>";

I'm unaware of any module doing that in its entirety, but maybe you want to just serve up the ascii page with Content-Type: text/plain instead of Content-Type: text/html ?

Replies are listed 'Best First'.
Re^2: [ASCII 2 HTML] Appearently unable to find simple module!
by blazar (Canon) on Nov 30, 2008 at 14:10 UTC

    I personally believe that it does exactly what I need, except that as I wrote in the root node I would probably further wrap the the <pre> tags in <div> ones, and that's what I meant with "concocting up a solution of my own." (I can't remember the exact expression I used, but that's not fundamental...)

    As a side note, it's not a matter of serving the page in any particular way: I'm just generating a standalone HTML single file for visualization purpose playing a little with css settings. It's not really a webby thing if you know what I mean...

    --
    If you can't understand the incipit, then please check the IPB Campaign.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-19 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found