hash of ref to array of arrays, lost all but the last element in hash

2001-08-23 Thread Jennifer Pan
Dear all, I would like to construct a hash, whose value holds a reference to an array of arrays, however all the keys in my hash have the exact same value, which turns out to be the value of the last element I put it!! I felt that something is wrong in the data structure, that I should

RE: Splitting a string into a Array of Arrays

2001-07-31 Thread Mooney Christophe-CMOONEY1
You're actually very close. I would just change a couple of things. First of all, you don't need @data as well as @rows. $element is aliased to each element in the array as it loops, so you can re-assign right back into the same array when you split. This will cause the loop to independent of

hash array of arrays?

2001-07-29 Thread Pozsar Balazs
Hi all, here's my question :): I define a hash array: our %R=(first = [ one, two ], second = [third, fourth]); Now I can get back back array references from this using: $R{first} I also can get back the elements of this array: $R{first}-[0]and so on.. but i would need to pass the whole

Re: hash array of arrays?

2001-07-29 Thread Jos I. Boumans
just dereference it: foo( @{ $R{first} } ); it's as easy as that =) hth Jos Boumans Hi all, here's my question :): I define a hash array: our %R=(first = [ one, two ], second = [third, fourth]); Now I can get back back array references from this using: $R{first} I also can

Sort an array of arrays?

2001-07-24 Thread Harry Goldhagen
Anyone know how to sort an array of arrays? To sort on the first column ($j = 0), I tried: $j = 0; for $i (0..$#AddBook) { @col = $AddBook[$i][$j]; @sortcol = sort @col; print Column $j contains: @col\n; } for $i (0..$#AddBook) { print Column $j sorted contains: @sortcol\n; } I get the last

RE: Sort an array of arrays?

2001-07-24 Thread Wagner-David
Here is a reply to an email on another list regarding sorting of array of arrays. Cut and run(I did it on AS 5.6.0 build 623). From this you should be able to do what you want. Wags

<    1   2