[Catalyst] Accessing $c from Model

Mark Zealey mark at itsolve.co.uk
Wed Dec 27 16:15:40 GMT 2006


On Wednesday 27 December 2006 1:01 pm, Ash Berlin wrote:
> Very very *VERY* bad idea.
>
> __PACKAGE__->mk_accessors(context);
>
> sub ACCEPT_CONTEXT {
>    my ($self, $c, @args) = @_;
>
>    my $new = bless({ %$self }, ref $self);
>    $new->context($c);
>    return $new;
> }

Isn't that really really slow though? Constructing a new object for each call?



More information about the Catalyst mailing list