[EMAIL PROTECTED] schrieb:
> I'm seeking any suggestions on how one may gain access to embedded POD
> documentation from a compiled Perl script?
> 
> Environment:
> Target OS: Windows (XP primarily)
> (All tools are currently designed for Windows XP use only--although
> some may later be modified for use on some UNIX-based systems as well;
> e.g., Linux, SunOS, HP-UX)
> Build Host OS: Windows XP
> Perl Version: ActiveState v5.8.7
> Compiler: ActiveState PerlApp v6.0.2
> 
> Problem Description:
> All our tools need to be compiled for corporate world-wide access and
> we prefer not to have to supply a separate POD file with every tool on
> our servers.
> 
> Solution Desired:
> We want to be able to deploy a single executable image file (that
> contains bound POD documentation) for each Perl/Tk tool so that any
> user may view the tool's POD documentation via its command line options
> or its GUI help pop-up window.
> 
> Partial Solution Found:
> I have managed to get command line access to a tool's embedded POD
> documentation using pod2usage and binding the POD source file to the
> compiled executable.  However, I have not been able to find a way to
> access the same bound POD documentation from within the tool's (Tk)
> GUI.
> 
> My latest attempt uses 'parse_from_file' within the GUI's help method.
> However, it only works as long as the script containing the POD
> documentation accompanies the executable.  Using pod2usage, on the
> other hand, dumps the POD info to the console window rather than the
> GUI pop-up window created by the Help toolbar button.  Probably
> pod2usage is the way to go (since it already works with the embedded
> bound file), but I have not found a way to redirect its output to the
> GUI pop-up window.
> 
> The following code snippet works for the command line options (where
> $POD is the file name of the bound POD source file):
> 
>     pod2usage (-input => $POD, -exitstatus => 0,  -verbose => 0) if
> $options{help};


use IO::Lines;
pod2usage -output to a filehandle
use the getlines() method from the handle.

This will work for Perl/Tk or Win32::GUI and par executables, but not
for perlapp exe's. par dump's the script, but perlapp keeps the script
in memory. PAR is almost as good as perlapp and it's free.

For perlapp exe's you'll have to dump the pod in a pre-step (via the
Makefile) into a temp file, bind this file into the exe ressource, and
use this internally. Look into perl2app --help how to detect perl2app at
run-time and the methods to access the bound textfile.

I'll post my snippets later when I'm at work.
-- 
Reini Urban
http://phpwiki.org/
http://helsinki.at/  http://spacemovie.mur.at/

Reply via email to