NAME
perl5i - Bend Perl 5 so it fits how it works in my imagination
SYNOPSIS
use perl5i;
DESCRIPTION
THIS MODULE'S INTERFACE IS UNSTABLE! It's still a playground. Features may be added, changed and removed without notice. You have been warned.
Perl 5 has a lot of warts. There's a lot of individual modules and techniques out there to fix those warts. perl5i aims to pull the best of them together into one module so you can turn them on all at once.
This includes adding features, changing existing core functions and changing defaults. It will likely not be backwards compatible with Perl 5, so perl5i will try to have a lexical effect.
Please add to my imaginary world, either by telling me what Perl looks like in your imagination (http://github.com/schwern/perl5i/issues or make a fork (forking on github is like a branch you control) and implement it yourself.
What it does
perl5i enables each of these modules. We'll provide a brief description here, but you should look at each of their documentation for full details.
Modern::Perl
Turns on strict and warnings, enables all the 5.10 features like given/when
, say
and state
, and enables C3 method resolution order.
CLASS
Provides CLASS
and $CLASS
alternatives to __PACKAGE__
.
File::stat
Time::Piece
Causes localtime
, gmtime
and stat
to return objects rather than long arrays which you never remember which bit is which.
Module::Load
Adds load
which will load a module from a scalar without requiring you to do funny things like eval require $module
.
autodie
The autodie module causes system and file calls which can fail (open
, system
and chdir
, for example) to die when they fail. This means you don't have to put or die
at the end of every system call, but you do have to wrap it in an eval
block if you want to trap the failure.
autodie's default error messages are pretty smart.
All of autodie will be turned on.
autobox
autobox allows methods to defined for and called on most unblessed variables.
autobox::Core
autobox::Core wraps a lot of Perl's built in functions so they can be called as methods on unblessed variables. <@a-
pop>> for example.
BUGS
Some part are not lexical.
Want to include Time::y2038 but it doesn't play nice with Time::Piece which uses CORE::localtime and CORE::gmtime.
NOTES
Inspired by chromatic's Modern::Perl and in particular http://www.modernperlbooks.com/mt/2009/04/ugly-perl-a-lesson-in-the-importance-of-language-design.html.
I totally didn't come up with the "Perl 5 + i" joke. I think it was Damian Conway.
LICENSE
Copyright 2009, Michael G Schwern <schwern@pobox.com>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
SEE ALSO
Repository: http://github.com/schwern/perl5i/tree/master Issues/Bugs: http://github.com/schwern/perl5i/issues