go ahead... be a heretic | |
PerlMonks |
Re^3: Optimizing non-alphanumeric method callsby LanX (Saint) |
on Sep 27, 2015 at 19:12 UTC ( [id://1143167]=note: print w/replies, xml ) | Need Help?? |
> but it cannot be used, unfortunately, on chained method calls, such as $obj->$method_1->$method_2, unless the result returned by $obj->$method_1 is stored somewhere, which I guess it may slow things down quite a bit. I'm not sure what you mean, $c_method isn't different in this respect to the other approaches you have proposed. For chained method calls you need to return the object in intermediate calls, no matter which approach you use. Maybe you should show us some real code to make things clearer.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|