Prep for 5.62 release
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 59b30c2..97dfc4e 100644 (file)
@@ -246,7 +246,10 @@ in an arrayref. The action will receive the arguments in C<@_> and
 C<$c-E<gt>req-E<gt>args>. Upon returning from the function,
 C<$c-E<gt>req-E<gt>args> will be restored to the previous values.
 
-    $c->forward('/foo');
+Any data C<return>ed from the action forwarded to, will be returned by the
+call to forward.
+
+    my $foodata = $c->forward('/foo');
     $c->forward('index');
     $c->forward(qw/MyApp::Model::CDBI::Foo do_stuff/);
     $c->forward('MyApp::View::TT');
@@ -471,10 +474,16 @@ L<Catalyst::Engine>.
 
 =head2 $c->log
 
-Returns the logging object instance. Unless it is already set, Catalyst
-sets this up with a L<Catalyst::Log> object. To use your own log class:
+Returns the logging object instance. Unless it is already set, Catalyst sets
+this up with a L<Catalyst::Log> object. To use your own log class, set the
+logger with the C<< __PACKAGE__->log >> method prior to calling
+C<< __PACKAGE__->setup >>.
+
+ __PACKAGE__->log( MyLogger->new );
+ __PACKAGE__->setup;
+
+And later:
 
-    $c->log( MyLogger->new );
     $c->log->info( 'Now logging with my own logger!' );
 
 Your log class should implement the methods described in the
@@ -937,14 +946,14 @@ sub execute {
         # this is done by walking up the call stack and looking for a calling
         # sub of Catalyst::forward before the eval
         my $callsub = q{};
-        for my $index (1..10) {
-            last 
-                if ( ( caller($index) )[0] eq 'Catalyst'
+        for my $index ( 1 .. 10 ) {
+            last
+              if ( ( caller($index) )[0] eq 'Catalyst'
                 && ( caller($index) )[3] eq '(eval)' );
-            
-            if ( (caller($index))[3] =~ /forward$/ ) {
-                $callsub = (caller($index))[3];
-                $action = "-> $action";
+
+            if ( ( caller($index) )[3] =~ /forward$/ ) {
+                $callsub = ( caller($index) )[3];
+                $action  = "-> $action";
                 last;
             }
         }