Plotinus has asked for the wisdom of the Perl Monks concerning the following question:

Hi, just trying to convert a perl script into .exe using pp (part of PAR). Currently using a test script but no matter what script I use I get the same error message... Here is a script snippet (I've not included actual rest of the code as I tried the 'pp -o' command with several scripts all of which work as .pl and all of which give the same error)...
#!/usr/bin/perl # Created on 01-Sep-2004 12:29:29 use strict; use Tk; use diagnostics; ... ...
I ran the command "pp -o spript.exe script.pl" to create the stand alone executable but when I run it the error message is...

"couldn't find diagnostic data in D:\cpanrun\build\5-8-0\lib/pods/perldiag.pod CODE(0xe336d0) CODE(0xd3a158) . li3.exe at C:/Perl/lib/Diagnostics.pm line 249, <POD_DIAG> line 24739. Compilation failed in require at script/li2.pl line 7, <POD_DIAG> line 24739. BEGIN failed--compilation aborted at script/li2.pl line 7, <POD_DIAG> line 24739"

Now I removed the line "use diagnostics" and "use strict", no improvement I tried -M perldiag.pod and -l c:\perl\lib\pod\perldiag.pod no improvement I also tried -M diagnostics but then I get a whole new error message (not including this second error as I suspect it is a red herring to the problem)

Thanks in advance

Plotinus

Replies are listed 'Best First'.
Re: stand alone executable using "pp -o" wont stand alone!
by ysth (Canon) on Dec 17, 2004 at 09:48 UTC
    I"ve never used PAR, but I'm not surprised to find that it doesn't bundle perldiag.pod for you...(until someone fixes it to do so, that is). I am surprised to hear you say "no improvement" came from removing the "use diagnostics;"...are you using modules that also use diagnostics? Try getting rid of it everywhere, and say what error message you get then if it still doesn't work. (You should probably not just remove the "use diagnostics;", but instead replace it with "use warnings;", since I think it does that for you.)
Re: stand alone executable using "pp -o" wont stand alone!
by sasikumar (Monk) on Dec 17, 2004 at 10:09 UTC
    Hi,
    Try this out  pp -o out.exe -e 'print "Hi!"' If this works
    fine then all others should also work fine.
    couldn't find diagnostic data in D:\cpanrun\build\5-8-0\lib/pods/perldiag.pod CODE(0xe336d0) CODE(0xd3a158) . li3.exe at C:/Perl/lib/Diagnostics.pm line 249, <POD_DIAG> line 24739. Compilation failed in require at script/li2.pl line 7, <POD_DIAG> line 24739. BEGIN failed--compilation aborted at script/li2.pl line 7, <POD_DIAG> line 24739"

    just chk whether you have this file in the specified place
    D:\cpanrun\build\5-8-0\lib/pods/perldiag.pod
    The error states hlaf of the path in unix and other half in
    windows. May be try to install perl from the active
    state if u have a perl from the cpan.
    Thanks
    Sasi Kumar
      I am using activeperl (will remember to mention this next time I post). Also since I want to use this as a standalone executable perldiag.pod will be missing (as will the rest of PERL) on any machine that this runs on. I'll try the use warnings and the one liner test. Thank you for the extremely quick replies.
        Thank you monks of distinction ;-)  pp -o out.exe -e 'print "Hi!"' didn't run but  pp -o out.exe -e "print \"Hi!\"" did which proved that the basic installation worked. Then I replaced 'use diagnostics' with 'use warnings' and that did the trick. Bit confused though as to why simply removing the line 'use warnings' didn't fix the fault.