Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Catalyst reload, 'use parent' and mro c3

by vsespb (Chaplain)
on Dec 23, 2015 at 19:50 UTC ( [id://1151079]=note: print w/replies, xml ) Need Help??


in reply to Re: Catalyst reload, 'use parent' and mro c3
in thread Catalyst reload, 'use parent' and mro c3 (UPD: NOT Catalyst)

Probably just clear @ISA manually?
Yes, that would work. Sad that I should insert this line too all of hundreds of files.

Replies are listed 'Best First'.
Re^3: Catalyst reload, 'use parent' and mro c3
by Anonymous Monk on Dec 23, 2015 at 20:14 UTC
    Well, you can fix parent.pm instead... it's a very simple module:
    package parent; use strict; use vars qw($VERSION); $VERSION = '0.232'; sub import { my $class = shift; my $inheritor = caller(0); if ( @_ and $_[0] eq '-norequire' ) { shift @_; } else { for ( my @filename = @_ ) { if ( $_ eq $inheritor ) { warn "Class '$inheritor' tried to inherit from itself\n"; } s{::|'}{/}g; require "$_.pm"; # dies if the file is not found } } { no strict 'refs'; my %ISA = map { $_ => 1 } @{"$inheritor\::ISA"}; for (@_) { push @{"$inheritor\::ISA"}, $_ if not $ISA{$_}; } }; } 1;
    just put it somewhere in @INC before the standard one, and let us know if it works :)
      code looks good.
      just put it somewhere in @INC before the standard one
      probably better monkey-patch this: redefine and "sub import" in package "parent" somewhere in existing code (not in new "parent.pm") in order to not to make deploy more complicated. or even do this in catalyst dev-mode only.
      Is this still a parent.pm bug?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found