Advertisement
Guest User

Untitled

a guest
Sep 24th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.37 KB | None | 0 0
  1. # Inside of app.pm6:
  2.  
  3. #--
  4. use Bailador;
  5. Bailador::import;
  6.  
  7. get / ^ '/blog/' \d+ $ / => sub ($post) {
  8.     template 'blog.tmpl',{ post => $post }
  9. }
  10. #--
  11.  
  12.  
  13. # Inside of blog.tmpl:
  14.  
  15. #--
  16. % my ($h) = @_;
  17. <html>
  18. <body>
  19. <%= slurp "posts/{$h<post>}.html" %>
  20. </body>
  21. </html>
  22. #--
  23.  
  24. # Output:
  25.  
  26. #--
  27. # Too many positionals passed; expected 0 arguments but got 1
  28. #--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement