Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I actually love chaining methods (I changed a whole lot of methods in XML::Twig so they would return something that can be chained). What's not to love about being able to write:
(apart from the fact that you could do all of this with CSS of course ;--) ? I agree that sometimes it can get a little confusing though, when the returned object/value is not obvious: should $elt->delete_atts return the element, so you can chain method calls on it, or should it return the attribute hash so you can store it? Overall I think it makes for elegant code. You'll get use to it ;--) In reply to Re: chaining method calls
by mirod
|
|