Permalink
Browse files

initial import of Modern-Perl 1.00 from CPAN

git-cpan-module:   Modern-Perl
git-cpan-version:  1.00
git-cpan-authorid: CHROMATIC
git-cpan-file:     authors/id/C/CH/CHROMATIC/Modern-Perl-1.00.tar.gz
  • Loading branch information...
0 parents commit 171b2b893a09e9c7cf8caebf78c6ecfca3d03d6b @chromatic committed Jan 26, 2009
Showing with 216 additions and 0 deletions.
  1. +21 −0 Build.PL
  2. +4 −0 Changes
  3. +7 −0 MANIFEST
  4. +21 −0 META.yml
  5. +46 −0 README
  6. +100 −0 lib/Modern/Perl.pm
  7. +17 −0 t/base.t
@@ -0,0 +1,21 @@
+BEGIN { require 5.010 }
+
+use strict;
+use warnings;
+
+use Module::Build;
+
+my $builder = Module::Build->new(
+ module_name => 'Modern::Perl',
+ license => 'perl',
+ dist_author => 'chromatic <chromatic@wgz.org>',
+ dist_version_from => 'lib/Modern/Perl.pm',
+ build_requires => {
+ 'Test::Simple' => 0.80,
+ 'B::Hooks::Parser' => 0.08,
+ 'perl' => 5.010,
+ },
+ add_to_cleanup => [ 'Modern-Perl-*' ],
+);
+
+$builder->create_build_script();
@@ -0,0 +1,4 @@
+Revision history for Modern::Perl
+
+1.00 Mon Jan 26 22:41:28 UTC 2009
+ - First version, released on an unsuspecting world.
@@ -0,0 +1,7 @@
+Build.PL
+Changes
+MANIFEST
+README
+lib/Modern/Perl.pm
+t/base.t
+META.yml
@@ -0,0 +1,21 @@
+---
+name: Modern-Perl
+version: 1.00
+author:
+ - 'chromatic <chromatic@wgz.org>'
+abstract: enable all of the features of Modern Perl with one command
+license: perl
+resources:
+ license: ~
+build_requires:
+ B::Hooks::Parser: 0.08
+ Test::Simple: 0.8
+ perl: 5.01
+provides:
+ Modern::Perl:
+ file: lib/Modern/Perl.pm
+ version: 1.00
+generated_by: Module::Build version 0.31
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.2.html
+ version: 1.2
46 README
@@ -0,0 +1,46 @@
+Modern::Perl
+------------
+
+Modern Perl often relies on the presence of several core and CPAN pragmas and
+modules. Wouldn't it be nice to use them all with a single command? Try this
+one:
+
+ use Modern::Perl;
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+ $ perl Build.PL
+ $ perl ./Build
+ $ perl ./Build test
+ $ sudo perl ./Build install
+
+SUPPORT AND DOCUMENTATION
+
+After installing, you can find documentation for this module with the
+perldoc command.
+
+ perldoc Modern::Perl
+
+You can also look for information at:
+
+ RT, CPAN's request tracker
+ http://rt.cpan.org/NoAuth/Bugs.html?Dist=Modern-Perl
+
+ AnnoCPAN, Annotated CPAN documentation
+ http://annocpan.org/dist/Modern-Perl
+
+ CPAN Ratings
+ http://cpanratings.perl.org/d/Modern-Perl
+
+ Search CPAN
+ http://search.cpan.org/dist/Modern-Perl/
+
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2009 chromatic
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
@@ -0,0 +1,100 @@
+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.00
+
+=cut
+
+our $VERSION = '1.00';
+
+use B::Hooks::Parser;
+
+sub import
+{
+ my $id = B::Hooks::Parser::setup();
+ B::Hooks::Parser::inject( 'use 5.010;use strict;use warnings;' );
+ B::Hooks::Parser::teardown($id);
+}
+
+=head1 SYNOPSIS
+
+Modern Perl programs use several modules to enable additional features of Perl
+and of the CPAN. Instead of copying and pasting all of these C<use> lines,
+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.
+
+See
+L<http://http://www.modernperlbooks.com/mt/2009/01/toward-a-modernperl.html>
+for more information, and L<http://www.modernperlbooks.com/> for further
+discussion of Modern Perl and its implications.
+
+=head1 AUTHOR
+
+chromatic, C<< <chromatic at wgz.org> >>
+
+=head1 BUGS
+
+None known.
+
+Please report any bugs or feature requests to C<bug-modern-perl at
+rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Modern-Perl>. I will be
+notified, and then you'll automatically be notified of progress on your bug as
+I make changes.
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc Modern::Perl
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Modern-Perl>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Modern-Perl>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Modern-Perl>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Modern-Perl/>
+
+=back
+
+=head1 ACKNOWLEDGEMENTS
+
+Damian Conway (inspiration from L<Toolkit>), Florian Ragwitz
+(L<B::Hooks::Parser>, so I didn't have to write it myself).
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2009 chromatic, all rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl 5.10 itself.
+
+=cut
+
+1; # End of Modern::Perl
@@ -0,0 +1,17 @@
+#! perl
+
+use Test::More tests => 3;
+
+use Modern::Perl;
+
+eval 'say "# say() should be available";';
+is( $@, '', 'say() should be available' );
+
+eval '$x = 1;';
+like( $@, qr/Global symbol "\$x" requires explicit/,
+ 'strict should be enabled' );
+
+my $warnings;
+local $SIG{__WARN__} = sub { $warnings = shift };
+my $y =~ s/hi//;
+like( $warnings, qr/Use of uninitialized value/, 'warnings should be enabled' );

0 comments on commit 171b2b8

Please sign in to comment.