Subject: | Use more when perldoc not available |
Pod::Usage with verbose=>2 tries to use perldoc to display the entry.
My suggestion is to use more when perldoc is not available. In my code I check if the executing module is perl or perl.exe and if not I assume that the sources are packed in an executable (In my case perl2exe produced) and use more. More is available on all of the platforms that I work with.
It may be better to test for the existance of perldoc before deciding to use more.
I feel that this is a more elegant solution than -noperldoc.
Thank you for a great module.
Danny Bud
--- Usage.pm.bak Mon Sep 05 23:11:26 2005
+++ Usage.pm Wed Jan 04 09:30:23 2006
@@ -543,7 +543,9 @@
and $opts{"-output"} == \*STDOUT )
{
## spit out the entire PODs. Might as well invoke perldoc
- my $progpath = File::Spec->catfile($Config{scriptdir}, "perldoc");
+ my $progpath=($^X =~ /(perl|perl\.exe)$/i) ?
+ File::Spec->catfile($Config{scriptdir}, "perldoc") :
+ "more";
system($progpath, $opts{"-input"});
}
else {