in reply to Re: Perl2Exe and POD
in thread Perl2Exe and POD

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

Replies are listed 'Best First'.
Re^3: Perl2Exe and POD
by Corion (Patriarch) on Mar 18, 2011 at 16:14 UTC

    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.

Re^3: Perl2Exe and POD
by Anonymous Monk on Mar 18, 2011 at 16:15 UTC
    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.