Dermot wrote: > Why wouldn't you, as you write, use the the fastest access methods > available? Surely you'd want to develop habits that will a) provide > better performance and b) as mentioned below avoid the thorny > side-effects of req->params(). This isn't a matter of premature > optimisation but simply establishing good practise.
Answering this in the general case. If you know that the object is stored as a hash, yes you can access it like a hash - but that's your risk. When you upgrade your modules and it switches to being stored some other way - you get to fix all your code. That's one of the things that many perl coders like - to the degree that it's perl culture - you *can* poke inside the box if you want but you have to accept the risks that go with that. As far as other optimisations, yes it's nice to develop some good habits but you don't want that to be at the expense of maintainability. Even if you're a team of one - you will still have to come back and maintain your own code at some future time. I have plenty of code that I wrote and understood very well at the time, but is a confusing mess now! So if an optimisation doesn't impact maintenance too much it's worth turning into a habit. eg print with a list rather than using concatination Carl _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/