Advertisement
Guest User

Untitled

a guest
Mar 15th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.34 KB | None | 0 0
  1. package Mojolicious::Plugin::MySub;
  2. use Mojo::Base 'Mojolicious::Plugin';
  3.  
  4. sub register {
  5.    my $self = shift;
  6.    my $app  = shift;
  7.  
  8.    $app->helper( mysub => sub { 1 } );
  9. }
  10.  
  11. 1;
  12.  
  13. ## app.pl
  14.  
  15. #!/usr/bin/env perl
  16.  
  17. use Mojolicious::Lite;
  18. plugin 'Mojolicious::Plugin::MySub';
  19.  
  20. mysub '/test' => sub {
  21.   my $self = shift;
  22. };
  23. app->start;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement