Skip Menu |

This queue is for tickets about the Class-Delegation CPAN distribution.

Report information
The Basics
Id: 2582
Status: new
Priority: 0/
Queue: Class-Delegation

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: mod_perl (or Apache::Registry) compatibility
Too late to run INIT block at c:/Perl/site/lib/Class/Delegation.pm line 22. [Thu May 15 00:06:43 2003] [error] Can't locate object method "retrieve_node" via package "CGI::Wiki::Simple::NoTemplates" (perhaps you forgot to load "CGI::Wiki::Simple::NoTemplates"?) at c:/Perl/site/lib/CGI/Wiki/Simple.pm line 379. I hope there is a workaround for the INIT block issue. Is an INIT block really neccessary? Do I need to load the module in my apache conf?
[PODMASTER - Thu May 15 03:02:41 2003]: Show quoted text
> Too late to run INIT block at c:/Perl/site/lib/Class/Delegation.pm > line 22. > [Thu May 15 00:06:43 2003] [error] Can't locate object method > "retrieve_node" via package "CGI::Wiki::Simple::NoTemplates" > (perhaps you forgot to load "CGI::Wiki::Simple::NoTemplates"?) at > c:/Perl/site/lib/CGI/Wiki/Simple.pm line 379. > > I hope there is a workaround for the INIT block issue. > Is an INIT block really neccessary? > Do I need to load the module in my apache conf?
I thought the following might work, but it does not Change Delegation.pm to look like sub _install_it_at_init{ foreach my $class (keys %mappings) { install_delegation_for($class); } } BEGIN { eval { INIT { _install_it_at_init(); } } unless $ENV{MOD_PERL}; } and then in a program that uses modules which use Class::Delegation, after all the use lines, i'd do a Class::Delegation::_install_it_at_init(); but I start getting memory access violations (this is 'SERVER_SOFTWARE' => 'Apache/1.3.27 (Win32) mod_perl/1.27_01-dev', ) I will ask on the mod_perl mailing list
Well one workaround would be to do the delegation in import, but that would require writing stuff like package Car; use strict; sub new { ... use Class::Delegation send => 'steer', to => ["left_front_wheel", "right_front_wheel"] ; 1; # end of package which I don't think is that bad.