vsespb has asked for the wisdom of the Perl Monks concerning the following question:
UPD: all true, except the thing which reload modules in dev mode was not Catalyst's but our code, which simply "do $modulefile".
I am running Catalyst in dev mode. It's able to reload packages when package's file modified.
One of my packages:
package SRS::MyTest; use parent 'File::Find'; our @ISA; BEGIN { print STDERR "HEREISIT @ISA\n"}; 1;
If i modify it, catalyst will reload it, and then I see in console:
HEREISIT File::Find File::Find - /somepath/MyTest.pm reloaded 2343
That means File::Find is now twice in @ISA. Not a big problem until you use MRO C3
With mro C3 it fails with error: "Inconsistent hierarchy during C3 merge of class"
I believe these are separate part of this problem:
PoC of problem without catalyst:
$ cat s1.pl package XXX; BEGIN { require mro; mro::set_mro( "XXX", 'c3' ); } use parent qw( File::Find ); use parent qw( File::Find ); 1; $ perl s1.pl Inconsistent hierarchy during C3 merge of class 'XXX': current merge results [ XXX, ] merging failed on 'File::Find' at /usr/share/perl/5.14/parent.pm l +ine 26. BEGIN failed--compilation aborted at s1.pl line 4.
Questions are:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Catalyst reload, 'use parent' and mro c3
by Anonymous Monk on Dec 23, 2015 at 19:35 UTC | |
by vsespb (Chaplain) on Dec 23, 2015 at 19:50 UTC | |
by Anonymous Monk on Dec 23, 2015 at 20:14 UTC | |
by vsespb (Chaplain) on Dec 23, 2015 at 20:24 UTC | |
by Anonymous Monk on Mar 12, 2024 at 12:23 UTC |