in reply to Creating the right type of array...

NCW, how would you grab the fourth item in ONLY the first OTI? and then the fourth in second OTI. I don't want to access them through a for loop but rather grab them individually. ex.
print "4th item in OTIs\n"; for $key (@{$data->{OTI}}) { print " $key->[3]\n"; }
The output from that would be WEDI620000802 0021000095 Again, I would like to access those each individually instead of looping through them and grabbing them both at the same time.

Replies are listed 'Best First'.
RE: Re: Creating the right type of array...
by Boogman (Scribe) on Aug 31, 2000 at 00:00 UTC
    You just say $data{OTI}->[0][3].

    The first index number will indicate which line it is (i.e. 0 for the first OTI line, the 1 for second OTI line, etc.) while the second number indicates the element in that line. So just write: $data{type}->[line][element] to access the element you want.