From: David Kamholz Date: Fri, 10 Mar 2006 12:46:54 +0000 (+0000) Subject: very minor cleanup to SubRequest X-Git-Tag: v0.15~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-SubRequest.git;a=commitdiff_plain;h=5bd316a5c1d9cf7939e2df1994011a9178cb7c16 very minor cleanup to SubRequest --- diff --git a/SubRequest.pm b/SubRequest.pm index 969b752..d22cb78 100644 --- a/SubRequest.pm +++ b/SubRequest.pm @@ -4,7 +4,6 @@ use strict; our $VERSION = '0.09'; - =head1 NAME Catalyst::Plugin::SubRequest - Make subrequests to actions in Catalyst @@ -37,11 +36,10 @@ parameters are put into the stash. *subreq = \&sub_request; -use Data::Dumper qw/Dumper/; sub sub_request { my ( $c, $path, $stash, $params ) = @_; - $path =~ s/^\///; + $path =~ s#^/##; local $c->{stash} = $stash || {}; local $c->res->{body} = undef; local $c->req->{arguments} = $c->req->{arguments}; @@ -51,12 +49,12 @@ sub sub_request { $c->req->path($path); $c->req->params($params || {}); - $c->prepare_action(); - $c->log->debug("Subrequest to $path , action is ". $c->req->action ) + $c->prepare_action; + $c->log->debug("Subrequest to ${path}, action is ". $c->req->action ) if $c->debug; # FIXME: Hack until proper patch in NEXT. local $NEXT::NEXT{$c,'dispatch'}; - $c->dispatch(); + $c->dispatch; return $c->res->body; }