|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re: help with hashesby gaal (Parson) |
| on Mar 15, 2005 at 11:56 UTC ( #439597=note: print w/ replies, xml ) | Need Help?? |
|
To subscript a hash, say $aminoacids{ $the_key }. (In your case, the keys are numeric so you may as well be using an array?) This interpolates in a string, too, so you can say: print "$aminoacids{$i} $aminoacids{$j} $aminoacids{$k}\n"; Though you can use the more idiomatic hash slice and select several things at once.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||