Changing scalar set behavior

Michael G Schwern <[email protected]> Tue, 07 Feb 2006 14:22:36 -0800
Newsgroups gmane.comp.lang.perl.modules.class-methodmaker
Message-ID <[email protected]>
Hi, I have two questions about MethodMaker.  Here's the first.

I'm working with a large, existing, in-house code base which is stuck on 
MethodMaker version 1.05.  The reason is because it overrides 
_make_get_set().  The override is nearly a straight copy except it 
changes the setters to return the original object.  That is

	package Foo;
	use Our::Class::MethodMaker
		get_set => qw/ foo bar baz /,
		new	=> 'new';

	my $foo = Foo->new
		     ->foo(23)
		     ->bar(42);

this is equivalent to:

	my $foo = Foo->new;
	$foo->foo(23);
	$foo->bar(42);

This style is ingrained in the code and the developers, I can't change 
the style so I have to change MethodMaker.  So my question is how do I 
do this in MethodMaker v2?  And make it work for both get_set and 
scalar?  And without once again driving into a forward incompatibility hole?


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642