Suresh Govindachar wrote:
> Hello,
>
> Wanting to capture the output of perldoc with a perl variable,
> I looked at perldoc.bat. What perldoc.bat does is run the
> following script with the arguments given to perldoc:
<snip>
> 1) What does the following line do?
>
> eval 'exec C:\opt\perl\bin\perl.exe -S $0 ${1+"$@"}'
> if 0;
That's just running perl against the bat file.
> As far as I know, that line does nothing.
>
> 2) The lines that get the required documentation are:
>
> use Pod::Perldoc;
> exit( Pod::Perldoc->run() );
Right - once you run perl on the file instead of cmd.exe.
> I guess Pod::Perldoc->run() figures out what the user
> wants to look up by examining argv/argc, correct?
>
> Pod::Perldoc->run() returns success or failure, not the
> documentation. The documentation just gets printed.
> So I need to fool the code into printing to a variable.
> How would this be done?
>
> 3) Any better way to look up documentation into a perl variable?
Try something like (you may have to add paths if not on your path):
my @lines = `perldoc -f waitpid`;
print "Lines:[EMAIL PROTECTED]";
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs