With a patched swig the output of poly.pl should be: a is a Object/perl-object b is a Derived/perl-derived c is a Object/perl-object d is a Derived/perl-derived The self() function returns an Object*, but swig knows how to check the classname() function for the real C++ type. classname() must return a string that matches the C++ and Perl shadow class names. A typemap for the Object* (the return type of self) must also be provided in the interface file. With an unpatched swig or without the typemap from the interface file the output would be: a is a Object/perl-object b is a Derived/perl-derived c is a Object/perl-object d is a Derived/perl-object Note the difference in the last line, perl has lost the type information of the d pointer, and now thinks d is just an Object, not a Derived. Polymorphic pointers like this can be useful when returning pointers to related objects (neighbors, parents, children, ...) in a complex database. The self() pointer was just to simplify the example. Unless a typemap overrides the return type of a function (as in this example) the code should function as before, as no type-modifying typemaps were possible before this patch. -Drake Diedrich (Drake.Diedrich@anu.edu.au)