Skip to content

Commit

Permalink
mention that Perl 5.10 features are automatically enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 18, 2011
1 parent 93ba1b1 commit beb6304
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/Base.pm
Expand Up @@ -162,7 +162,7 @@ Mojo::Base - Minimal base class for Mojo projects
L<Mojo::Base> is a simple base class for L<Mojo> projects.
# Automatically enables "strict" and "warnings"
# Automatically enables "strict", "warnings" and Perl 5.10 features
use Mojo::Base -strict;
use Mojo::Base -base;
use Mojo::Base 'SomeBaseClass';
Expand Down
12 changes: 3 additions & 9 deletions lib/Mojo/Template.pm
Expand Up @@ -55,8 +55,7 @@ sub build {
my $self = shift;

# Compile
my @lines;
my $cpst;
my (@lines, $cpst);
my $multi = 0;
for my $line (@{$self->tree}) {

Expand Down Expand Up @@ -84,7 +83,6 @@ sub build {
# Quote and fix line ending
$value = quotemeta($value);
$value .= '\n' if $newline;

$lines[-1] .= "\$_M .= \"" . $value . "\";" if length $value;
}

Expand Down Expand Up @@ -123,11 +121,7 @@ sub build {
}

# Capture start
if ($type eq 'cpst') {

# Start block
$cpst = " sub { my \$_M = ''; ";
}
if ($type eq 'cpst') { $cpst = " sub { my \$_M = ''; " }
}
}

Expand All @@ -141,7 +135,7 @@ sub build {
. $lines[0];
$lines[-1] .= "$append; \$_M; } };";

# Done
# Final code
$self->code(join "\n", @lines);
$self->tree([]);

Expand Down
10 changes: 5 additions & 5 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -74,7 +74,7 @@ Mojolicious::Lite - Real-time micro web framework
=head1 SYNOPSIS
# Using Mojolicious::Lite will enable "strict" and "warnings"
# Automatically enables "strict", "warnings" and Perl 5.10 features
use Mojolicious::Lite;
# Route with placeholder
Expand All @@ -100,10 +100,10 @@ applications.
=head2 Hello World!
A simple Hello World application can look 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.
A simple Hello World application can look like this, L<strict>, L<warnings>
and Perl 5.10 features 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;
Expand Down

0 comments on commit beb6304

Please sign in to comment.