Array::Transpose::Ragged - Transpose a ragged array
Array::Transpose is a handy module to transpose a regular matrix.
using it with an irregular matrix will result in data loss.
This module transposes a ragged matrix.
Note that it will not preserve values which are
use warnings; use strict; use Array::Transpose::Ragged qw/transpose_ragged/; my @array = ( [qw /00 01/], [qw /10 11 12/], [qw /20 21/], [qw /30 31 32 33 34/], ); my @transpose = transpose_ragged(\@array);
The variable @transpose will now be:
@transpose = (['00' ,'10' ,'20' ,'30'], ['01' ,'11' ,'21' ,'31'], [undef,'12' ,undef,'32'], [undef,undef,undef,'33'], [undef,undef,undef,'34'] );
returns the max index length of the matrix
normalises the length of the matrix prior to calling
<zarquon at cpan.org>
The implementation could probably be far more efficient.
Please report any bugs or feature requests to
bug-array-transpose-ragged at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Array-Transpose-Ragged. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
Copyright 2010 Kieren Diment.
This program is released under the following license: BSD
See http://dev.perl.org/licenses/ for more information.