in reply to Re^2: introspection, or running pod2html on itself
in thread introspection, or running pod2html on itself

I spoke too soon. While Pod::Html does work very well, everything fails against a packed .exe created with pp. Seems like the package stuffs the script inside a folder within the .exe. So, if my script is myscript.pl, and I do the following
pp -o myscript.exe myscript.pl

myscript.pl gets stuffed as script/myscript.pl within the confines of myscript.exe. Hence, pod2html is unable to create anything against myscript.exe (because the pod is hidden inside the script).

That is very disappointing. I could take other monks' advice and use the __DATA__ block to store my html doc and then spit it out as needed, however, I have already got everything mapped out and typed up in pod. What a chore to extract it and redo as html.

unless... any suggestions (asks hopefully).

By the way, how do I find out the full path of the current script? __FILE__ or $0 give only the filename (actually, __FILE__ against the above exe gives script/myscript.pl)

--

when small people start casting long shadows, it is time to go to bed

Replies are listed 'Best First'.
Re^4: introspection, or running pod2html on itself
by Anonymous Monk on Oct 23, 2009 at 12:15 UTC
    Try this, save as ppselfdoc.PL, and make sure not to invoke pp with -f PodStrip :)
    #!/usr/bin/perl -- use strict; use warnings; use Pod::Html; use PAR; if (@ARGV){ print "$_\n" for PAR::read_file( q!script/ppselfdoc.PL!); } else { $ENV{PAR_0} ||= File::Spec->rel2abs(__FILE__); warn "RUNNING pod2html $ENV{PAR_0}\n"; my @html_options = ('--title=My Test'); pod2html $ENV{PAR_0}, @html_options; } exit; =head1 NAME NAME - ppselfdoc.PL =head1 SYNOPSIS print html ppselfdoc.PL print sourcecode ppselfdoc.PL 1 =cut