Alt-IO-All-new
view release on metacpan or search on metacpan
NAME
Alt::IO::All::new - Alternate IO::All - The Rewrite
SYNOPSIS
> cpanm Alt::IO::All::new
use IO::All;
DESCRIPTION
This is a rewrite of the infamous IO::All. The new design is detailed
below.
STATUS
This is a very early release. It's just barely operational. Enough to
upload to CPAN under the new experimental "Alt-" namespace.
"IO::ALL" DESIGN
This is a design document for an upcoming version of IO::All.
IO::All is a Perl module that attempts to make all Input/Output
operations in Perl, as simple and normal as possible. IO::All has been
in existence since 2005. It is useful and somewhat extensible, but has a
number of inconsistencies, flaws and misgivings.
This document will propose a better way to do it, and will also discuss
how to move the current API forward to the new API.
BASIC PRINCIPLES OF HOW "IO::ALL" SHOULD WORK
* IO::All provides a single entry point function called "io".
* "use IO::All" should make this function available in a lexical
scope.
* Currently this scope is 'package' scope.
* Would be nice, but maybe not possible to have true lexical
scope.
* The "io" function is custom to its scope
* The behavior it provides depends on the state of the scope
* The behavior it provides also depends on the arguments passed to
"use IO::All"
* "io" returns an IO::All object
* The IO::All object has no I/O capabilities
* Further method calls invoke a context, causing the IO::All
object to rebless itself it something useful like IO::All::File.
* Certain methods force a rebless
* `file(...), dir(...), socket(...), etc
* These methods are more or less hard-coded currently
* Options to "use IO::All" that begin with a "-", cause a method to be
called on each new IO::All object.
* use IO::All -strict, -encoding => 'big5'; # causes:
* io('foo')->print('hi'); # to mean:
* io('foo')->strict->encoding('big5')->print('hi');
* IO::All operations generally return other IO::All objects
* Often they return themselves ($self) for chaining
* IO::All needs to be completely and consistently extensible
* The extensions that ship with IO-All should be the same as third
party extensions
( run in 0.965 second using v1.01-cache-2.11-cpan-b16cb0d3907 )