Skip to content

Commit

Permalink
improved Mojo::Template documentation a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 27, 2012
1 parent 2aa87e4 commit 59bd4ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.53 2012-10-27
3.53 2012-10-28
- Improved documentation.

3.52 2012-10-26
Expand Down
11 changes: 5 additions & 6 deletions lib/Mojo/Template.pm
Expand Up @@ -442,17 +442,16 @@ Perl lines can also be indented freely.
%= $block->('Baerbel')
%= $block->('Wolfgang')
L<Mojo::Template> templates work just like Perl subroutines (actually they get
compiled to a Perl subroutine internally). That means you can access arguments
simply via C<@_>.
L<Mojo::Template> templates get compiled to a Perl subroutine, that means you
can access arguments simply via C<@_>.
% my ($foo, $bar) = @_;
% my $x = shift;
test 123 <%= $foo %>
Templates get compiled to Perl code internally, this can make debugging a bit
tricky. But L<Mojo::Template> will return L<Mojo::Exception> objects that
stringify to error messages with context.
Since templates are just Perl code, debugging can get a bit tricky at times,
but L<Mojo::Template> will return L<Mojo::Exception> objects that stringify to
error messages with context.
Bareword "xx" not allowed while "strict subs" in use at template line 4.
2: </head>
Expand Down

0 comments on commit 59bd4ab

Please sign in to comment.