in reply to dynamic matrix

See Re: text processing - convert list of vectors to tabular format for a variation on this theme that uses $table->[$horiz]->[$vert] type syntax, which to my mind seems more "matrixlike" than tirwan's solution above. I think this way it is easier to grab the horizontal vectors if that's what you want to do, or the verticals if you want them. Whereas in tirwan's solution , feels to me like one axis is "preferred." (The horizontal vectors.)

Replies are listed 'Best First'.
Re^2: dynamic matrix
by tirwhan (Abbot) on Dec 19, 2005 at 16:09 UTC

    Well, all you need to do to use the same syntax with my solution is

    $table=\@matrix;

    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan
      True. And thanks for pointing that out, enlightening. However, I still feel like
      my $matrix =[ [1,5,7], [2,3,4], [5,1,9], [7,8], [3] ] ;
      feels more "aesthetically" right than setting it up with @matrix like you did above, and then $matrix = \@matrix... even if both are equivalent.