Advertisement
Guest User

Untitled

a guest
Oct 4th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #!/usr/bin/env perl
  2. use Mojolicious::Lite;
  3. use Email::Stuffer;
  4.  
  5. # Documentation browser under "/perldoc"
  6. plugin 'PODRenderer';
  7.  
  8. get '/' => sub {
  9. my $c = shift;
  10. $c->render('index');
  11.  
  12. my $body = <<'AMBUSH_READY';
  13. Dear Santa
  14.  
  15. I have killed Bun Bun.
  16.  
  17. Yes, I know what you are thinking... but it was actually a total accident.
  18.  
  19. I was in a crowded line at a BayWatch signing, and I tripped, and stood on
  20. his head.
  21.  
  22. I know. Oops! :/
  23.  
  24. So anyways, I am willing to sell you the body for $1 million dollars.
  25.  
  26. Be near the pinhole to the Dimension of Pain at midnight.
  27.  
  28. Alias
  29.  
  30. AMBUSH_READY
  31.  
  32. # Create and send the email in one shot
  33. Email::Stuffer->from ('login@student.42.fr' )
  34. ->to ('login@student.42.fr' )
  35. ->text_body($body )
  36. ->send;
  37. };
  38.  
  39. app->start;
  40. __DATA__
  41.  
  42. @@ index.html.ep
  43. % layout 'default';
  44. % title 'Welcome';
  45. Welcome to the Mojolicious real-time web framework!
  46.  
  47. @@ layouts/default.html.ep
  48. <!DOCTYPE html>
  49. <html>
  50. <head><title><%= title %></title></head>
  51. <body><%= content %></body>
  52. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement