Hi.

In Catalyst::Manual::WritingPlugins there is a couple of discrepancies
between the code in the Example and the lines in the walkthrough
below it.

Attached is a patch (against current) that attempts to fix it
(assuming the Example is the correct version).


  Best regards,

    Adam

-- 
                                                          Adam Sjøgren
                                                    [EMAIL PROTECTED]

Index: Catalyst-Runtime/lib/Catalyst/Manual/WritingPlugins.pod
===================================================================
--- Catalyst-Runtime/lib/Catalyst/Manual/WritingPlugins.pod     (revision 4753)
+++ Catalyst-Runtime/lib/Catalyst/Manual/WritingPlugins.pod     (working copy)
@@ -184,19 +184,19 @@
 
 These methods are called without attributes (Private, Local, etc.).
 
-    my $c = shift;
+    my $class = shift;
 
 We get the context object for this request as the first argument. 
 
 B<Hint!>:Be sure you shift the context object out of C<@_> in this. If
 you just do a
 
-  my ( $c ) = @_;
+  my ( $class ) = @_;
 
 it remains there, and you may run into problems if you're not aware of
 what you pass to the handler you've overloaded. If you take a look at
 
-    $c = $c->NEXT::prepare( @_ );
+    $c = $class->NEXT::prepare( @_ );
 
 you see you would pass the context twice here if you don't shift it out
 of your parameter list.
@@ -214,13 +214,13 @@
 context before calling the actual handler would be setting header
 information before C<finalize> does its job.
 
-    $c->req->{req_uuid} = Data::UUID->new->create_str;
+    $c->request->uuid( Data::UUID->new->create_str );
 
 This line creates a new L<Data::UUID> object and calls the C<create_str>
-method. The value is saved in our request, under the key C<req_uuid>. We
+method. The value is saved in our request, under the key C<uuid>. We
 can use that to access it in future in our application.
 
-    $c->log->debug( 'Request UUID "'. $c->req->{req_uuid} .'"' );
+    $c->log->debug( 'Request UUID "'. $c->request->uuid .'"' );
 
 This sends our UUID to the C<debug> log.
 
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to