Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: CGI::Carp in Apache::Registry

by Anonymous Monk
on Jan 24, 2012 at 22:35 UTC ( #949783=note: print w/ replies, xml ) Need Help??


in reply to CGI::Carp in Apache::Registry

You can't, it is not designed for that

sub set_progname { $CGI::Carp::PROGNAME = shift; return $CGI::Carp::PROGNAME; }

You can probably use

BEGIN { set_progname( 'script_1.cgi' ); } END { set_progname( undef ); } Main( @ARGV );


Comment on Re: CGI::Carp in Apache::Registry
Select or Download Code
Re^2: CGI::Carp in Apache::Registry
by bbfan (Novice) on Jan 24, 2012 at 23:20 UTC
    Hey, thanks for the suggestion. Sounded good, so gave it a try - had the same result as before. Went to see "when" an END block would get executed in Apache::Registry, and it's just what you might suspect - when the script or interpreter exits - which is why am seeing the same result.

    http://perl.apache.org/docs/2.0/api/ModPerl/Registry.html#C_END__Blocks

      What is wrong with the default, caller...?

      In that case, copy/paste Carp.pm and fix it to your liking :) say it sets/checks  ${(caller)[0].'::PROGNAME'} instead, which ought to work under registry

Re^2: CGI::Carp in Apache::Registry
by bbfan (Novice) on Jan 25, 2012 at 00:17 UTC
    In thinking about this, am confused why it "seems to" work fine when not using the precompilation. If it is not designed for that, then how come it works? Am still fuzzy on much of the language. Thanks!

      In thinking about this, am confused why it "seems to" work fine when not using the precompilation.

      What do you mean by that? do you mean when it is run through mod_cgi?

        What do you mean by that? do you mean when it is run through mod_cgi?

        Am not "intentionally" using mod_cgi, so don't know enough to address that part. What I meant by it seeming to work is that when the CGI::Carp qw(name=scriptX) lines are in each registry script, they *were* logging the appropriate script name *until* I introduced precompilation. Please see my initial post for clarification. Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://949783]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-10-01 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (392 votes), past polls