Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 musing on the Monastery: (8)
As of 2014-12-25 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls