in reply to Re: printing array values
in thread printing array values

thanks for your reply

then could you please let me know how i can retreive a particular value from that hash, say for e.g fvalues{3}

Replies are listed 'Best First'.
Re^3: printing array values
by blazar (Canon) on May 19, 2005 at 09:11 UTC
    The problem is that there may not be a such a thing as $fvalue{3}. More precisely, hashes are not indexed by numbers, but by keys (strings).

    You may want to store your values in a real array. But then you should discard the keys. Or else you may want an array of arrays (AoA), each of which containing the key and the value. Or a HoA or an AoH. Who knows?!?

    You may also want to push your keys into an array for "sequential" retrieving. But then again, who knows?!? All this smells byzantine and suggests you may have an "XY problem": you are asking X, but you really want to do Y.

    I ask you to trust me when I tell you that this is "very" x 10 basic perl. I recommend reading some basic {introduction,tutorial}...