Skip to content

Commit

Permalink
Minor improvements:
Browse files Browse the repository at this point in the history
    - removed duplicate use lines (Damien Learns Perl)
    - fixed (hopefully) v-string warnings (Damien, David Moreno)
    - enabled C3 MRO (Evan Carroll)
  • Loading branch information
chromatic committed Jan 5, 2012
1 parent 86cda74 commit 9aed02a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 13 deletions.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Revision history for Modern::Perl

1.03 Wed Feb 18 00:40:40 UTC 2009
- removed duplicate use lines (Damien Learns Perl)
- fixed (hopefully) v-string warnings (Damien, David Moreno)
- enabled C3 MRO (Evan Carroll)

1.02 Tue Jan 27 03:44:29 UTC 2009
- removed the current need for B::Hooks::Parser (suggested by chocolateboy)

Expand Down
4 changes: 2 additions & 2 deletions META.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Modern-Perl
version: 1.02
version: 1.03
author:
- 'chromatic <chromatic@wgz.org>'
abstract: enable all of the features of Modern Perl with one command
Expand All @@ -13,7 +13,7 @@ build_requires:
provides:
Modern::Perl:
file: lib/Modern/Perl.pm
version: 1.02
version: 1.03
generated_by: Module::Build version 0.31
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
Expand Down
22 changes: 12 additions & 10 deletions lib/Modern/Perl.pm
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
package Modern::Perl;

use strict;
use warnings;

=head1 NAME
Modern::Perl - enable all of the features of Modern Perl with one command
=head1 VERSION
Version 1.02
Version 1.03
=cut

our $VERSION = '1.02';
our $VERSION = '1.03';

use 5.10.0;
use 5.010_000;

use strict;
use warnings;

use mro ();
use feature ();

sub import {
warnings->import();
strict->import();
feature->import(':5.10');
feature->import( ':5.10' );
mro::set_mro( scalar caller(), 'c3' );
}

=head1 SYNOPSIS
Expand All @@ -37,8 +36,9 @@ instead write only one:
use Modern::Perl;
For now, this only enables the L<strict> and L<warnings> pragmas, as well as
all of the features available in Perl 5.10. In the future, it will include
additional CPAN modules which have proven useful and stable.
all of the features available in Perl 5.10. It also enables C3 method
resolution order; see C<perldoc mro> for an explanation. In the future, it
will include additional CPAN modules which have proven useful and stable.
See L<http://www.modernperlbooks.com/mt/2009/01/toward-a-modernperl.html> for
more information, and L<http://www.modernperlbooks.com/> for further discussion
Expand Down Expand Up @@ -90,7 +90,9 @@ L<http://search.cpan.org/dist/Modern-Perl/>
Damian Conway (inspiration from L<Toolkit>), Florian Ragwitz
(L<B::Hooks::Parser>, so I didn't have to write it myself), chocolateboy (for
suggesting that I don't even need L<B::Hooks::Parser>, at least for now).
suggesting that I don't even need L<B::Hooks::Parser>, at least for now),
Damien Learns Perl, David Moreno, and Evan Carroll for reporting bugs and
requesting features.
=head1 COPYRIGHT & LICENSE
Expand Down
28 changes: 27 additions & 1 deletion t/base.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! perl

use Test::More tests => 4;
use Test::More tests => 5;

BEGIN
{
Expand All @@ -19,3 +19,29 @@ my $warnings;
local $SIG{__WARN__} = sub { $warnings = shift };
my $y =~ s/hi//;
like( $warnings, qr/Use of uninitialized value/, 'warnings should be enabled' );

eval<<'END_CLASSES';
package A;
$A::VERSION = 1;
package B;
@B::ISA = 'A';
package C;
@C::ISA = 'A';
package D;
use Modern::Perl;
@D::ISA = qw( B C );
END_CLASSES

package main;

is_deeply( mro::get_linear_isa( 'D' ), [qw( D B C A )], 'mro should use C3' );

0 comments on commit 9aed02a

Please sign in to comment.