Perl Monk, Perl Meditation | |
PerlMonks |
Cygwin Pod::Usage malfunction?by Ambidangerous (Scribe) |
on May 20, 2004 at 18:35 UTC ( [id://355042]=perlquestion: print w/replies, xml ) | Need Help?? |
Ambidangerous has asked for the wisdom of the Perl Monks concerning the following question: Greetings, Perl Monks . . . . Under three different Perls (ActiveState 5.8.3, Cygwin 5.8.2 precompiled, Cygwin 5.8.4 my compile), the following program does two different things, and after playing with it all day, I still can't figure it out. PURPOSEThis program was automatically generated by a 'cookie cutter' program I wrote called anew.pl. It provides the basic skeleton for any quickie command line utility, using Getopt::Std and Pod::Usage to deliver a default --help and --version command for the new file. The POD documentation embedded at the end normally is much larger; I've edited it here for space. MISBEHAVIORIt runs exactly as expected under AS Perl. Under either the Cyg prebuilt (or my recent build of 5.8.4 for Cyg), everything works, except --help or -h. Instead of the Pod::Usage you'd expect, you get a blank line. MY TESTSI have isolated the problem to something in the HELP_MESSAGE() function. Inserting a print "Here I am!!!" in the sub always works. Something seems to be wonky with Pod::Usage. I thought this might be some sort of problem with $0 (a tip given in the Pod::Usage docs), but no, when I have it print $0, it's ok, even in the varying invocations
Also, when I deliberately hose the Pod::Usage module by specifying a bad input file { -input = "/you/are/hosed.pl" }, it properly complains about it. Just out of paranoia, I tried it with both DOS and UNIX endlines. No difference. FINALLYA search of PM returned an article on coupling these two modules in the way I used, but made no mention of bugs or inconsistent behavior. Any help would be appreciated.
Back to
Seekers of Perl Wisdom
|
|