On Mon, Mar 26, 2012 at 03:52:37PM -0400, Steve Scaffidi wrote:
> So, recently I ended up having to write a whole lot of shell (bash),
> and it sucked. However, it seemed like a necessity for that task
> because bash (and most other ksh-family shells) has a killer feature -
> process substitution.
> 
>   cat /some/huge/file \
>   | tee \
>     >(gzip -c /some/huge/file.gz) \
>     >(md5 > /home/huge/file.md5) \
>     >(shasum -a 256 > /home/huge/file.sha) \
>   >/dev/null

This feature is incredibly useful and one of my favourite tools.

> At some point I went looking on the CPAN for something that would let
> me do this sort of thing easily in Perl, but sadly, to no avail...
>
> So.. I now have a working implementation! However, I'm not sure about
> the interface/API I've created.

Nor am I :-) but I'm struggling to come up with something that doesn't
suck horribly.

> So, I'm looking for comments on the API, and what others would like to
> see.

I don't think it matters what the API looks like, provided that it's
complete.  People who don't like your API can always roll their own
wrapper around it, like what File::Find::Rule does for File::Find.  I
can imagine circumstances when I'd want an OO-ish interface and others
when I'd want a functional stylee interface, so I suggest that you write
a nasty old *procedural* interface and then provide Some::Module::OO
and Some::Module::Functional wrappers in the same distribution.  Or just
leave those for other people to write, of course.

-- 
David Cantrell | semi-evolved ape-thing

    [OS X] appeals to me as a monk, a user, a compiler-of-apps, a
    sometime coder, and an easily amused primate with a penchant
    for those that are pretty, colorful, and make nice noises.
        -- Dan Birchall, in The Monastery

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to