Skip to content

Instantly share code, notes, and snippets.

@hidekiy
Created April 12, 2010 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hidekiy/363617 to your computer and use it in GitHub Desktop.
Save hidekiy/363617 to your computer and use it in GitHub Desktop.
use strict;
use Mojolicious::Lite;
get '/test1' => 'test1';
get '/test2' => 'test2';
app->start;
__DATA__
@@ test1.html.ep
<%{ my $block1 = %>
<% my $name = shift; =%>
Hello <%= $name %>.
<%}%>
<%= $block1->('Sebastian') %>
<%= $block1->('Sara') %>
%{ my $block2 =
% my $name = shift;
Hello <%= $name %>.
%}
%= $block2->('Baerbel')
%= $block2->('Wolfgang')
@@ test2.html.ep
<%{ my $block1 = %>
<% my $name = shift; =%>
Hello <%= $name %>.
<%}%>
<%= $block1->(undef, 'Sebastian') %>
<%= $block1->(undef, 'Sara') %>
%{ my $block2 =
% my $name = shift;
Hello <%= $name %>.
%}
%= $block2->(undef, 'Baerbel')
%= $block2->(undef, 'Wolfgang')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment