Class::MethodMaker has a method maker called "object" that declares a slot to be of a particular object type. For example:
use Class::MethodMaker
new_hash_init => 'new',
object => [ HTML::Mason::Lexer => 'lexer' ];
You can then choose to proxy selected methods from the contained class. For example, to create a class called CGI::Simple that contains a CGI.pm object in a slot called 'query' and proxies new() and param() to it:
package CGI::Simple;
use Class::MethodMaker
new_hash_init => 'new',
object => [ CGI => {
slot => 'query',
comp_mthds => [ 'new',
'param' ],
}
];
This seems just nextdoor to your module to me.
-sam
|