Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: [Moose] extends(...) throws "Subroutine redefined" warnings

by kcott (Archbishop)
on Oct 08, 2015 at 04:58 UTC ( [id://1144139]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -MMyClass -le 'print SubClass::->new()->get_subclass_object()'
    MyClass already has a metaclass, but it does not inherit Moose::Meta::
    +Class (Class::MOP::Class=HASH(0x7f918c72e440)). at /Users/ken/perl5/p
    +erlbrew/perls/perl-5.22.0t/lib/site_perl/5.22.0/darwin-thread-multi-2
    +level/Moose/Exporter.pm line 484
    ...
    BEGIN failed--compilation aborted at MyClass.pm line 3.
    Compilation failed in require.
    BEGIN failed--compilation aborted.
    
  2. or download this
    package MyClass;
    use Moose;
    use SubClass;
    
  3. or download this
    $ perl -MMyClass -le 'print SubClass::->new()->get_subclass_object()'
    SubClass=HASH(0x7fc4f2bb4148)
    
  4. or download this
    $ perl -MSubClass -le 'print SubClass::->new()->get_subclass_object()'
    SubClass=HASH(0x7fb6698259a8)
    
  5. or download this
    sub get_subclass_object {
        my $class = ref $_[0];
        return $class->new;
    }
    
  6. or download this
    package OtherSubClass;
    use Moose;
    ...
    extends 'MyClass';
    
    1;
    
  7. or download this
    $ perl -MSubClass -le 'print SubClass::->new()->get_subclass_object()'
    SubClass=HASH(0x7fae2280f258)
    
  8. or download this
    $ perl -MOtherSubClass -le 'print OtherSubClass::->new()->get_subclass
    +_object()'
    OtherSubClass=HASH(0x7fa721030da8)
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-03-28 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found