|more useful options|
unhappy with Pod::Htmlby dada (Chaplain)
|on May 14, 2003 at 13:06 UTC||Need Help??|
dada has asked for the wisdom of the Perl Monks concerning the following question:
a few days ago I was doing some data munging on the perlfaq manpages (basically, splitting each page in single faqs and put them in a DB table) and after a while I realized I had the need to convert a snippet of POD (a single faq) to HTML.
I promptly typed use Pod::Html; but suddenly I felt something was wrong. what I wanted was something like:
but Pod::Html seems to be nothing more than a backend for the (totally fine) pod2html script. Thus, it only accepts input from a file (or STDIN) and writes to a file (or STDOUT). gack.
for my application, which is a CGI script, I was absolutely reluctant to spool on the filesystem, and while I can think about redirecting STDOUT to a variable, setting up a fake STDIN for pod2html to read from a variable looks, at the very least, unnecessarily complicated.
after a bit of homework, I found a solution (workaround?) to my problem:
it works ($html_snippet will contain the pod2htmlized $pod_snippet), but it required the installation of 4 additional modules (let alone syntactic cruft and efficiency concerns), just to make something that Pod::Html could, and should, very easily handle.
so the question is: am I the only one to think that Pod::Html should do far, far much more than it does now? and if it doesn't want to do it, let's kick it out from CPAN! ;-)
King of Laziness, Wizard of Impatience, Lord of Hubris