in reply to Perl2Exe and POD

an .exe is a binary file, to use pod2usage, you have to do something like ppselfdoc

Replies are listed 'Best First'.
Re^2: Perl2Exe and POD
by MKJ747 (Acolyte) on Mar 18, 2011 at 16:05 UTC

    I know an exe is binary - I'm not sure what you are suggesting. I am using pod::usage to output text messages from my script when needed, like a help and man screen. When running the EXE, it should work the same as running the script e.g.,

    script.pl -h -> print help text

    script.exe -h -> print help text

    Shouldn't this behave the same? Thanks

      Pod::Usage works by reading the (Perl) source code of your main program. Ideally, Pod::Usage would know about how you packed your Perl program into an .exe format file, but it doesn't, so it can't extract the source code of your main program to create the help text. This is why it won't work without you doing some work.

      I'm not sure what you are suggesting.

      I showed you one solution, based on PAR. perl2exe has similar caveats, and a similar solution (give pod2usage a text file with pod to read)

      When running the EXE, it should work the same as running the script e.g.,.... Shouldn't this behave the same? Thanks

      No. pod2usage reads $0 (a text file, a perl program) unless you tell it different. With perl2exe $0 is the binary file .exe, so you need to tell pod2usage to read a text file, not the .exe

        OK, that makes more sense now. Thanks for the additional explanation. I will try it out.