let you run code in the middle of a pipeline of commands. This is the killer feature for fully participating in pipelines, instead of just running them (as Perl and Python do).
(For bonus points, the code should be able to change the global state of the program instead of just running in a sub-process.)
That said, I was thinking of something that worked within Perl's syntax, e.g.
io("file.txt") | sub { ... } | io("| frob > file2.txt");
But "|"'s precedence is a pain, there's the question of line-at-a-time vs. whole-output, etc.
perl -e'use overload ">" => sub { use Data::Dumper; print Dumper \@_ }; my @a; my $o = bless []; $o > \@a'
The overload sub clearly gets passed an arrayref; the arrayref doesn't get numified first or anything annoying like that.
Someone just needs to make a few adjustments to the following IO::All methods to detect when the scalar is an arrayref and DWIM.
* This differs from Alt in that Alt is about alternate implementation, while this is about alternate interface. Also, Alt-* distributions contains module with the same name as the target, so no two alternate implementation can coexist in the same installation (but that's beside the point).
* Aside from this ::NonOO stuff, there can be various alternate interfaces. ::Simple also fits here?
* For alternate OO implementation (e.g. original module uses Moose, one might create a Moo or Mouse version), this fits quite fine with the Alt scheme, although one might also choose to still use module suffix like ::Moo and ::Mouse (or ::NoMoose?) so multiple implementation can coexist.
]]>