Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.35 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/env perl
  2.  
  3. use Mojolicious::Lite;
  4.  
  5. get '/' => sub {
  6.     my $self = shift;
  7.     $self->write_chunk(
  8.         '<!doctype html><html><head><title>Test</title></head>' => sub {
  9.             my $self = shift;
  10.             $self->write_chunk('<body>Test!</body></html>');
  11.             $self->write_chunk('');
  12.         }
  13.     );
  14. };
  15.  
  16. app->start;