[Catalyst] http://www.catalystframework.org/calendar/2008/8
sub ACCEPT_CONTEXT { my ($self, $c ) = @_; $self = bless({ %$self, path_to => $c->path_to(''), }, ref($self)); return $self; } Sorry, I'm a bit curious about that code. Why is that done that way instead of simply: sub ACCEPT_CONTEXT { my ($self, $c ) = @_; $self->path_to( $c->path_to('') ); return $self; } Which would also avoid calling DESTROY every request. -- Bill Moseley mose...@hank.org Sent from my iMutt ___ 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/
Re: [Catalyst] http://www.catalystframework.org/calendar/2008/8
On Fri, Dec 12, 2008 at 08:37:25AM -0800, Bill Moseley wrote: > sub ACCEPT_CONTEXT { > my ($self, $c ) = @_; > $self = bless({ %$self, > path_to => $c->path_to(''), > }, ref($self)); > return $self; > } > > Sorry, I'm a bit curious about that code. Why is that done that way > instead of simply: Well, looking at the Moose example I can see that it's to clone the object. And DESTROY won't get called, obviously because the ref count. Never mind. ;) -- Bill Moseley mose...@hank.org Sent from my iMutt ___ 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/