On Friday, July 5, 2002, at 08:31 , Connie Chan wrote: [..] > If you want to know what 'fields' inside %Data : > @DataKeys = keys(%Data); > print "@DataKeys"; # So you get "Code, Birth, Name"... > # However, the elements order in @DataKeys is not base > #on how's the order you create your key field in %Data. > > If you want to know how many elements inside @DataKeys : > $total = $#DataKeys; > print $total; [..]
Connie - as you will note at: http://www.wetware.com/drieux/pbl/perlTrick/HA/PeekinIntoArrayOfArrays.txt You were mostly right - cool enough for me to knick your basic framework.... but $#DataKeys is the last Index into your keys, but scalar(@DataKeys) or even my $elements = @DataKeys; will give you the number of elements. I of course tweeked your data to make showing Nikolai that the indirection at that point is Mostly Irrelevant, in the > @all = (\@array1, \@array2 ... ); # ... so on > > to access first array and first element: > > $all[0]->[0]; # i think or is it: $all[0][0] both WORK - but folks should start getting paranoid about whether the thing at $all[$i] is actually an array or a scalar or a hash.... Given the OP's original assertion - the thought strikes me, If you have a fixed location in @array that you want to keep track of - AND you promise never to change stuff you could try my $value_found_at_slot_17 = $array[17]; And you will always be able to find what had been there.... ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]