Evan Carroll > nextgen > nextgen

Download:
nextgen-0.06.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

nextgen - enable all of the features of next-generation perl 5 with one command

VERSION ^

Version 0.01

SYNOPSIS ^

The nextgen pragma uses several modules to enable additional features of Perl and of the CPAN. Instead of copying and pasting all of these use lines, instead write only one:

    use nextgen;

But the joy doens't stop there, here are some examples of the command line.

    perl -Mnextgen -E'say Class->new->meta->name'
    
    # You can see warnings is on:
    perl -Mnextgen -E'(undef) + 5'
    
    # And, strict
    perl -Mnextgen -E'my $foo = "bar"; $$foo = 4; say $$foo'
    
    #   And, it wouldn't be nextgen if this was allowed.        
    perl -Mnextgen -E'use NEXT;'
    
    # Or, this
    perl -Mnextgen -MNEXT -e1

But the joy doesn't stop there, here are some examples in module.

    package Foo;
    ## easier than strict, warnings, indirect, autodie, mro-c3, Moose, and blacklist
    use nextgen;
    
    ## vanilla Moose to follow
    has "foo" => ( isa => "Str", is => "rw" )
    
    package main;
    use nextgen;
    
    ## this works
    my $o = Foo->new;
    
    ## this wouldn't
    ## main is understood to be mode => [qw/procedural])
    my $o = main->new

For now, this module just does

Perl assertion

asserts 5.10.1+ is loaded -- 5.10.0 is unsupported and not forwards compatable because of smart match.

strict and warnings

uses the vanilla strict, and warnings pragmas

features.pm

adds Perl 5.10 features

indirect.pm

disables indirect method syntax via indirect

autodie.pm

throws fatal exceptions in a sane fashion for CORE functions via autodie

mro.pm

C3 method resolution order via mro

Moose.pm

adds Moose if the package isn't main

oose.pm

uses oose.pm if the program is run via perl -e, or perl -E

namespace/autoclean.pm

cleans up the class via namespace::autoclean if the module has a constructor (sub new).

In the future, nextgen will include additional CPAN modules which have proven useful and stable.

This module started out as a fork of Modern::Perl, it wasn't modern enough and the author wasn't attentive enough to the needs for a more modern perl5.

PROCEDURAL CODE ^

If you wish to write nextgen module that doesn't assume non-"main" packages are object-oriented classes, then use the :procedural token:

    use nextgen mode => [qw(:procedural)]

    or even

    use nextgen mode => qw(:procedural)

AUTHOR ^

Evan Carroll, <me at evancarroll.com>

BUGS ^

Please report any bugs or feature requests to bug-nextgen at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=nextgen. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc nextgen

You can also look for information at:

ACKNOWLEDGEMENTS ^

Original Modern::Perl author

chromatic, <chromatic at wgz.org>

RT Bug report submitters

KSURI

LICENSE AND COPYRIGHT ^

Copyright 2010 and into the far and distant future, Evan Carroll.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: