in reply to accessing elements inside Math::Matrix

you could use the slice method to get a single column, which you can then index with [0] or whatever.

The other option is to subclass Math::Matrix, and add an access method.

     "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

  • Comment on Re: accessing elements inside Math::Matrix

Replies are listed 'Best First'.
Re^2: accessing elements inside Math::Matrix
by WoodyWeaver (Monk) on Mar 14, 2008 at 03:37 UTC
    Slice didn't do what I'd expected; in particular, the result from above was after I'd taken the slice. Frankly, subclassing someone else's class is too much work (although an accessor that pulls out a particular element of the matrix would make sense). The next comment, however, gave me the cleaner answer I was looking for -- the reference ->[0][0].