SPUG: method call during object construction
m3047 at inwa.net
Wed Feb 15 15:20:11 PST 2006
Wild guess (since you didn't supply the actual code for the new() or
change_name returns 'new_class_name' as its function value.
On Wed, 15 Feb 2006, Umar Cheema wrote:
> I was hoping to make this work:
> my $obj = Class->new('class_name')->change_name('new_class_name');
> But after the constructor call $obj simply holds the value returned by the
> 'change_name' method.
($obj = Class->new('class_name'))->change_name('new_class_name');
More information about the spug-list