in reply to Re^2: hash access with a variable
in thread hash access with a variable

This shouldn't be possible. If $gene_name contains precisely the string "ENSG0000017672", then $fastas{ENSG0000017672} and $fastas{$gene_name} will both compute to the exact same value.

So either $gene_name is getting mangled before your hash access, or $sequence afterwards. Could you share some more of your code so we can try and figure out where it's going wrong?