Skip to content

Commit

Permalink
fixed enabling of Perl 5.10 features in Mojo::Base and Mojolicious::Lite
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 9, 2011
1 parent c912390 commit fe49279
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -4,6 +4,8 @@ This file documents the revision history for Perl extension Mojolicious.
- Improved reloading slightly by allowing it to clean up the main
namespace.
- Improved documentation.
- Fixed enabling of Perl 5.10 features in Mojo::Base and
Mojolicious::Lite. (garu, sri)

1.31 2011-05-08 00:00:00
- Reverted deprecation of Perl 5.8.x support, by popular demand.
Expand Down
5 changes: 4 additions & 1 deletion lib/Mojo/Base.pm
Expand Up @@ -42,7 +42,10 @@ sub import {
warnings->import;

# Mojo modules are modern!
feature->import(':5.10') if $] >= 5.010;
if ($] >= 5.010) {
require feature;
feature->import(':5.10');
}
}

sub new {
Expand Down
5 changes: 4 additions & 1 deletion lib/Mojolicious/Lite.pm
Expand Up @@ -16,7 +16,10 @@ sub import {
warnings->import;

# Lite apps are modern!
feature->import(':5.10') if $] >= 5.010;
if ($] >= 5.010) {
require feature;
feature->import(':5.10');
}

# Executable
$ENV{MOJO_EXE} ||= (caller)[1];
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -98,7 +98,7 @@ sub register {
else { $args = shift || {} }

# Default name
$name ||= join '', map { $_ || '' } caller(1);
$name ||= join '', map { $_ || '' } (caller(1))[0 .. 3];

# Expire
my $expires = $args->{expires} || 0;
Expand Down

0 comments on commit fe49279

Please sign in to comment.