Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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

by Corion (Pope)
on Nov 30, 2008 at 13:21 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2021-11-27 06:39 GMT
Find Nodes?
    Voting Booth?

    No recent polls found