## in file Foo.pm: package Foo; use strict; use Class::Multimethods; multimethod new => ('$') => sub { print "I'm the constructor for Foo\n"; bless {},$_[0]; }; 1; ##in file Foo2.pm: package Foo2; use strict; use Class::Multimethods; multimethod new => ('$') => sub { print "I'm the constructor for Foo2\n"; bless {},$_[0]; }; 1; ## in main.pl: package main; use strict; use Foo; use Foo2; Foo->new(); Foo2->new(); ## ==== OUTPUT ==== ## #I'm the constructor for Foo2 #I'm the constructor for Foo2 #### package Foo; use strict; use Class::Multimethods; *Foo::new = \&_newFoo; multimethod _newFoo => ('$') => sub { print "I'm constructor for Foo\n"; bless {},$_[0]; }; 1; ## Foo.2pm package Foo2; use strict; use Class::Multimethods; *Foo2::new = \&_newFoo2; multimethod _newFoo2 => ('$') => sub { print "I'm constructor for Foo2\n"; bless {},$_[0]; }; 1; ## Now, it works as it should be. Of course with also other ## overloaded methods like _newFoo('$','HASH'),_newFoo2('$','$')