Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Storing large data in perl hash

by Rahul6990 (Beadle)
on Jan 25, 2013 at 06:27 UTC ( #1015271=perlquestion: print w/ replies, xml ) Need Help??
Rahul6990 has asked for the wisdom of the Perl Monks concerning the following question:

Is there any limit to store the values in hash? Have any one tried? I need to try to load about 1 lac values in hash. Is it recommended or else any suggestion welcome...

Comment on Storing large data in perl hash
Re: Storing large data in perl hash
by frozenwithjoy (Curate) on Jan 25, 2013 at 07:03 UTC
    I wasn't familiar with 'lac'. Is it 100,000?
      yes
Re: Storing large data in perl hash
by BrowserUk (Pope) on Jan 25, 2013 at 07:34 UTC
    Is there any limit to store the values in hash?

    Only the memory limits of your machine and userid.

    Have any one tried? I need to try to load about 1 lac values in hash.

    Yes. I routinely load 10s of millions of values into Perl hashes. 100,000 is no problem at all.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Storing large data in perl hash
by davido (Archbishop) on Jan 25, 2013 at 07:34 UTC

    my %hash; for ( 1 .. 100000 ) { $hash{$_} = "What did you try?"; } print "We just created a hash with ", scalar( keys %hash ), " elements +.\n";

    Works for me.


    Dave

Re: Storing large data in perl hash
by Rahul6990 (Beadle) on Jan 25, 2013 at 07:43 UTC
    Thanks everyone for help

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-10-21 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (99 votes), past polls