Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Pod 2 html formatter that will run online?

Reply
Thread Tools

Pod 2 html formatter that will run online?

 
 
Lars Eighner
Guest
Posts: n/a
 
      01-08-2009
Does anyone know of a Pod to HTML formatter that will run *online*?

--
Lars Eighner <http://larseighner.com/> http://www.velocityreviews.com/forums/(E-Mail Removed)
Bush's third term begins Jan. 20th with an invocation by Rick Warren.
Obama: No hope; No change; More of the Same.
 
Reply With Quote
 
 
 
 
Eric Pozharski
Guest
Posts: n/a
 
      01-09-2009
On 2009-01-08, Lars Eighner <(E-Mail Removed)> wrote:
> Does anyone know of a Pod to HTML formatter that will run *online*?


You've meant this?

pod2html precious.pod | elinks -force-html

--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
 
Reply With Quote
 
 
 
 
Lars Eighner
Guest
Posts: n/a
 
      01-09-2009
In our last episode, <(E-Mail Removed)-francisco.ca.us>, the
lovely and talented Keith Keller broadcast on comp.lang.perl.misc:

> On 2009-01-08, Lars Eighner <(E-Mail Removed)> wrote:
>> Does anyone know of a Pod to HTML formatter that will run *online*?


> How about pod2html? (minimally tested)


> #!/usr/bin/perl
> use strict;
> use warnings;
> use CGI;
> my $cgi=CGI->new;
> print $cgi->header;
> # if your perl sets -T when run under a webserver
> $ENV{PATH}='';


> print `/usr/bin/pod2html /usr/lib/perl5/5.8.4/Pod/Text.pm`;


In addition to the above, pod2html seems to require a scratch file,
so you have to change to a world readable and writeable directory, as it
runs as nobody.

As I am working in PHP, this works where tmp is a world writeable, world
readable directory below the current one.

<?php

$old = getenv('PATH');
echo '<p>',$old,' oldpath</p>';
putenv("PATH=''");
$ocwd = getcwd();
echo '<p>',$ocwd,' old current working directory</p>',
chdir('tmp');
$foo =
`/usr/local/bin/pod2html /usr/local/lib/perl5/5.8.8/pod/perldoc.pod`;
$foo = htmlspecialchars($foo);
putenv('PATH='.$old);
$foo = htmlspecialchars($foo);
echo '<p>',$foo,'<p>';
echo '<p>',getenv('PATH'),' restored path</p>';
chdir($ocwd);
echo '<p>',getcwd(),' restored current working directory</p>';

?>


--
Lars Eighner <http://larseighner.com/> (E-Mail Removed)
Bush's third term begins Jan. 20th with an invocation by Rick Warren.
Obama: No hope; No change; More of the Same.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Switching from XML formatter to Binary Formatter A.M-SG ASP .Net Web Services 1 11-22-2005 08:33 AM
Behaviour of htmllib's HTML parser and formatter Morten W. Petersen Python 0 03-11-2005 02:14 AM
Is array of POD still a POD type? Ajax Chelsea C++ 1 12-01-2003 01:56 PM
A (probable) error in perltoot ( perl5/5.8.0/pod/perltoot.pod, line number 756 ) Himanshu Garg Perl Misc 1 09-21-2003 03:28 AM



Advertisments