On Wed, 13 Aug 2003 11:23:41 +0100 (BST)
Mark Fowler <[EMAIL PROTECTED]> wrote:

> On Tue, 12 Aug 2003, Dan Brook wrote:
>
> > If you nab mapcar[0] this is insanely simple
> 
> Interesting.  Is there something like this on the CPAN?  It's a bit
> hard to put a page from perlmonks into a PREREQ_PM

There's nothing quite like mapcar with regards to it's simplicity[0], but
there is the transpose method from Math::Matrix[1] which should do it e.g

shell> perl -MData::Dumper -MMath::Matrix -e 'print Dumper( 
Math::Matrix->new([1..3],[5..7])->transpose )'
$VAR1 = bless( [
                 [
                   1,
                   5
                 ],
                 [
                   2,
                   6
                 ],
                 [
                   3,
                   7
                 ]
               ], 'Math::Matrix' );

Which is more or less like mapcar, minus the blessing.

[0] there is a mapcar method in the LISP module, but that's a horror show
    of a module
[1] http://search.cpan.org/author/ULPFR/Math-Matrix-0.4/Matrix.pm#transpose

Reply via email to