You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "T.J. Mather" <tj...@anidea.com> on 2001/02/03 01:25:44 UTC

INIT Blocks under mod_perl

Does anybody know if INIT blocks work under mod_perl?  I was trying to get
Geography::States to work under mod_perl and it doesn't seem to run the
code in the INIT block.  When I removed "INIT {" and the corresponding
"}" line from the Geography/States.pm file, the code ran fine.

I'm running mod_perl 1.24_01, Apache 1.3.14.

Thanks, TJ
_____________________________________________________________________
T.J. Mather				http://tjmather.com
http://cpan2.org/			New CPAN Search Engine
http://www.anidea.com/			Digital Asset Management
http://www.theinnkeeper.com/		Bed and Breakfast Directory


Re: INIT Blocks under mod_perl

Posted by Matt Sergeant <ma...@sergeant.org>.
On Sat, 3 Feb 2001, G.W. Haywood wrote:

> Hi there,
>
> On Fri, 2 Feb 2001, T.J. Mather wrote:
>
> > Does anybody know if INIT blocks work under mod_perl?  I was trying to get
> > Geography::States to work under mod_perl and it doesn't seem to run the
> > code in the INIT block.  When I removed "INIT {" and the corresponding
> > "}" line from the Geography/States.pm file, the code ran fine.
>
> Just remind me - what's an INIT block?

Its a perl 5.6 addition, its like BEGIN, but called after compilation and
before execution.

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\


Re: INIT Blocks under mod_perl

Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi there,

On Fri, 2 Feb 2001, T.J. Mather wrote:

> Does anybody know if INIT blocks work under mod_perl?  I was trying to get
> Geography::States to work under mod_perl and it doesn't seem to run the
> code in the INIT block.  When I removed "INIT {" and the corresponding
> "}" line from the Geography/States.pm file, the code ran fine.

Just remind me - what's an INIT block?

73,
Ged.