good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Why does this sub grab the whole hashby naturalsciences (Beadle) |
on Nov 11, 2011 at 17:50 UTC ( [id://937639]=perlquestion: print w/replies, xml ) | Need Help?? |
naturalsciences has asked for the wisdom of the Perl Monks concerning the following question: I used this little piece of code grabbed in my bigger script as a subroutine.
I had a has in my script connecting bunch of identification numbers with sequences. When I wanted to grab a sequence by a ID and run it through the sub.Lets say ..
Then what I got was a printout of reverse complements for EVERY single sequence in %hashofseqs. (Printout that shows that subroutine is ran on all "value" strings contained in hash) For print command or other such manipulations $stringforsequence is exactly what I would expect from it, a single sequence that corresponds to a certain someIDnr key. How come that this string somehow passes the whole of the hash into the subroutine? How could this be avoided? It is my first script actually containing some hashes. I try to learn a bit about them as they seem to be rahter useful elements for many a data manipulation. But as for now I'm rather dumbfounded.
Back to
Seekers of Perl Wisdom
|
|