Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

diagnostics pragma and PAR/pp

by rvosa (Curate)
on Jun 17, 2006 at 01:11 UTC ( [id://555923]=perlquestion: print w/replies, xml ) Need Help??

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

Dear monks,

I am trying to package a script (that runs fine on its own) using pp, the packaging utility of PAR. I use the following arguments:
/opt/local/bin/pp -c -B -M diagnostics -o mbwrap service.pl
but when I try to run it I get:
$ ./mbwrap No diagnostics? at diagnostics.pm line 429. Compilation failed in require at script/service.pl line 5. BEGIN failed--compilation aborted at script/service.pl line 5.
I am on Darwin 10.4.x, using the darwinports version of perl and pp (i.e. in /opt/local/bin). I'm at a loss where to go from here, the 'No diagnostics?' die is not very well documented. What is it complaining about?

Thanks!

Replies are listed 'Best First'.
Re: diagnostics pragma and PAR/pp
by Tanktalus (Canon) on Jun 17, 2006 at 02:58 UTC

    I've had issues with diagnostics on machines that aren't set up perfectly - and that's without PAR. For example, installing ActiveState Perl for Windows to a network share, and then everyone copying the shared version locally (for performance reasons). (Not my design.)

    What happens is that the diagnostics module will look in Config for where Perl is installed, and then look for perldiag.pod there. And that's where your trouble is. If only perldiag.pod were in the __END__ section of diagnostics.pm, PAR probably would incorporate it properly.

    I know this isn't a solution - short of "don't use that module in a PAR-enabled app", I don't have one. Mostly because I don't use PAR. But perhaps that will help you track down a solution.

      Thanks, this certainly helps me on my way. I don't have a lot of choice in terms of using diagnostics in the app - it's a dependency somewhere deep in the dependency tree. What I can do is change diagnostics.pm or Config.pm to either not look for perldiag.pod or to include it in the par app (and update a local Config.pm accordingly). Neither is the ideal solution, but I can stop pulling my hair out now. Thanks!
Re: diagnostics pragma and PAR/pp
by tsee (Curate) on Jun 18, 2006 at 17:24 UTC

    Hi rvosa,

    I just installed PAR 0.94 from CPAN on a freshly installed linux x86_64. Then I tried pp with the following script:

    #!/usr/bin/perl use strict; use warnings; use diagnostics; print "foo\n";

    And used the following command to package it:

    pp -o t -c -B t.pl

    This works flawlessly and prints "foo\n".

    Does this work for you? What version of Perl, PAR and Module::ScanDeps do you have? Does upgrading PAR and Module::ScanDeps to the current version help?

    Also, I have to tell you that using "diagnostics" in a module (i.e. in library code) is a bad idea. One should always turn that on in the application code since it shouldn't be used in production code. (I mean, honestly, will the end user benefit from the verbosity? No.)

    Steffen

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://555923]
Approved by GrandFather
Front-paged by tsee
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-24 21:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found