Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: To Hash or to Array--Uniqueness is the question.

by vennirajan (Friar)
on Dec 02, 2005 at 10:23 UTC ( #513550=note: print w/ replies, xml ) Need Help??


in reply to To Hash or to Array--Uniqueness is the question.

Its based on your requirement. I always prefer to use Hash. Because once you collected the data you can do lot of handy methods. For example, you can get the count of occurance of the data ( $hash{$data} .= + 1 ). Using the "value" we can say the number of occurances....etc. We can do some manipulations also using this key - value pairs. ( We can sort out the data by their occurance count,.etc ).later we can assign this unique data to the array also.( @array = keys %hashDataStructure );

So, using the hash for unique is always preferable.
Regards,
S.Venni Rajan.
"A Flair For Excellence."
    --- BK Systems.


Comment on Re: To Hash or to Array--Uniqueness is the question.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://513550]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2015-07-08 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (98 votes), past polls