Skip to content

Commit

Permalink
better hello world examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 26, 2011
1 parent 47c837a commit 2c1834e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.pod
Expand Up @@ -67,7 +67,7 @@ These three lines are a whole web application.

use Mojolicious::Lite;

get '/' => sub { shift->render_text('Hello World!') };
get '/' => {text => 'Hello World!'};

app->start;

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -333,7 +333,7 @@ These three lines are a whole web application.
use Mojolicious::Lite;
get '/' => sub { shift->render_text('Hello World!') };
get '/' => {text => 'Hello World!'};
app->start;
Expand Down
1 change: 0 additions & 1 deletion lib/Mojolicious/Command/Generate/LiteApp.pm
Expand Up @@ -25,7 +25,6 @@ __DATA__
@@ liteapp
%% my $class = shift;
#!/usr/bin/env perl
use Mojolicious::Lite;
# Documentation browser under "/perldoc" (this plugin requires Perl 5.10)
Expand Down
9 changes: 5 additions & 4 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -101,16 +101,18 @@ applications.
=head2 Hello World!
A minimal Hello World application looks like this, L<strict> and L<warnings>
A small Hello World application looks like this, L<strict> and L<warnings>
are automatically enabled and a few functions imported when you use
L<Mojolicious::Lite>, turning your script into a full featured web
application.
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub { shift->render(text => 'Hello World!') };
get '/' => sub {
my $self = shift;
$self->render(text => 'Hello World!');
};
app->start;
Expand Down Expand Up @@ -461,7 +463,6 @@ Here's a fully functional example for a html form handling application using
multiple features at once.
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => 'index';
Expand Down

0 comments on commit 2c1834e

Please sign in to comment.