An example
- The "fat controller" style
sub action :Whatever {
my ($self, $c) = @_;
if($c->user_exists){
my $data = $c->model('DBIC::Foo')->search({ foo => $c->req->params->{foo} });
if($data->count > 42){
$c->model('DBIC::FortyTwo')->create({ foos => $data->count });
}
}
else {
$c->model('DBIC::SixTimesNine')->create({ user => $c->user });
}
}
- Too much logic in the controllre
- Impossible to test
- Impossible to reuse
- Perl makes things possible, not impossible!
- so avoid!