Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: fasta hash

by ForgotPasswordAgain (Deacon)
on Aug 26, 2011 at 22:37 UTC ( #922749=note: print w/replies, xml ) Need Help??


in reply to Re^2: fasta hash
in thread fasta hash

As moritz said, 1 (or ++) is a common choice of value, but it's not necessarily the best one. It doesn't usually matter these days for 100k elements, but it's better (thanks, Liz! ;) for memory size to do something like this:

my ($undef); while (whatever...) { .... $hash{$key} = $undef; }

This way each element points to the same $undef value. Otherwise, each element would point to a different copy of the value 1. That's a kind of "poor man's aliasing". For bonus points, you might look at Array::RefElem or Data::Alias.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://922749]
help
Chatterbox?
[RonW]: Cool, stevieb
[stevieb]: Not to mention, the bundle has a C# IDE, so I can finally rid myself of using Visual Studio (or just vi/vim) when I work on berrybrew
[RonW]: I continue to avoid C#. And successfully
[stevieb]: I inhereted C#, so I had to become familiar with it pretty quickly. I am considering taking a crack at re-writing berrybrew in C++
[stevieb]: I haven't yet done the reserach needed to see if it's possible though

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2017-02-20 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (302 votes). Check out past polls.