Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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...

Replies are listed 'Best First'.
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 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 frozenwithjoy (Priest) 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 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?
[Corion]: marto: Yeah - on a whim I bought two or three back then, but now that I'm comfortable with putting LineageOS on them, they are not for sale anymore ;)
[Corion]: It's a difficult thing, timing your purchases so that alternative ROMs are available and stable just when the devices go on clearance sale :)
[Corion]: Maybe I should work more on my "price monitoring" framework, or talk to friends to get historic price data for gadgets and employ Machine Learning to predict "device goes on final sale" events :)
[Corion]: That might be a fun project but I have to talk to people on how to best get at historic price data if that's available at all :D
[Corion]: Also, I'd like to avoid (well, do I?) situations like with Le Eco, who went bust and all of their devices went on sale. But they had AOSP for their device already, so that was good.
[marto]: Meh, looking at prices, I may just get a cheapo Chinese Intel and stick linux on it :/
[Corion]: marto: Prices for what? Cheapo tablets? Cheapo notebooks?
[Corion]: I think there is an Asus Chromebook that works with Linux and is quite good. $boss has it, I think, but it's still EUR 400 or so...
[Corion]: (too much IMO to give it into the hands of kids ;) )

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2018-05-23 10:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?