Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- use Mojolicious::Lite;
- use Email::Stuffer;
- # Documentation browser under "/perldoc"
- plugin 'PODRenderer';
- get '/' => sub {
- my $c = shift;
- $c->render('index');
- my $body = <<'AMBUSH_READY';
- Dear Santa
- I have killed Bun Bun.
- Yes, I know what you are thinking... but it was actually a total accident.
- I was in a crowded line at a BayWatch signing, and I tripped, and stood on
- his head.
- I know. Oops! :/
- So anyways, I am willing to sell you the body for $1 million dollars.
- Be near the pinhole to the Dimension of Pain at midnight.
- Alias
- AMBUSH_READY
- # Create and send the email in one shot
- Email::Stuffer->from ('login@student.42.fr' )
- ->to ('login@student.42.fr' )
- ->text_body($body )
- ->send;
- };
- app->start;
- __DATA__
- @@ index.html.ep
- % layout 'default';
- % title 'Welcome';
- Welcome to the Mojolicious real-time web framework!
- @@ 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