... no value has ever been assigned to the variable $sequence.
No, it means $sequence is undef at that point, which was probably assigned to it by the statement the OP is having trouble with, $sequence=$fastas{$gene_name};. ($sequence could very well have held a value before then.)
... when you try to use $sequence as a hash key...
They're not, you probably mean $gene_name.
In reply to Re^4: hash access with a variable
by Anonymous Monk
in thread hash access with a variable
by LostWeekender
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |