Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- use Mojolicious::Lite;
- get '/' => sub {
- my $c = shift;
- my $output = qx{echo "hello there from the shell"};
- $c->render(template => 'index', text => $output);
- };
- app->start;
- __DATA__
- @@ index.html.ep
- % layout 'default';
- % title 'Welcome';
- <h1>Welcome to the Mojolicious real-time web framework!</h1>
- <p><$= text ></p>
- @@ layouts/default.html.ep
- <!DOCTYPE html>
- <html>
- <head><title><%= title %></title></head>
- <body><%= content %></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement