Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Pre-compiling constants in mod_perl

by nitin1704 (Sexton)
on Jul 17, 2012 at 04:33 UTC ( #982124=perlquestion: print w/ replies, xml ) Need Help??
nitin1704 has asked for the wisdom of the Perl Monks concerning the following question:

I was reading mod_perl2 User's Guide. In a perl startup file section, the phrase "pre-compile common constants" was mentioned. What does that mean?

The startup file also "pre-loads commonly used modules" which I understand, but I don't get what compiling constants means. Thanks for the help!

Here is some relevant code (which I don't understand) from the startup file:

use Apache2::Const -compile => 'OK'; use APR::Const -compile => ':common';

Comment on Pre-compiling constants in mod_perl
Download Code
Replies are listed 'Best First'.
Re: Pre-compiling constants in mod_perl
by Anonymous Monk on Jul 17, 2012 at 06:51 UTC
      Thanks a lot!

      So it just means that the constants are made available to the module, just not imported. So you still have to use them with their full names. E.g. Apache2::Const::OK instead of just OK

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2015-07-28 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls