Hi,
I'm trying to learn Perl and have been given the task of taking a fasta file containing a single DNA sequence and finding all of its EcoRI sites. I've been instructed to start by reading the fasta file using a while loop, and put the entire sequence into a scalar variable $sequence
. Now, I don't want to ask how to do this entire task, because I am trying to do as much myself as possible, but I haven't the foggiest idea how to do this first part. I have a fasta file and I need to get it into my scalar $sequence
. How would I do that? What would such a while loop look like? Reading in files is the part I have the least grasp on right now. Could someone explain and/or provide an example of what a while loop that reads a fasta file into a scalar would look like? I feel like I can solve the rest of this task on my own if I could just get past this very first step. Thanks!
Thank you, guys. You've all been very helpful with your tips and examples. I'm going to sit down later and try to put this all together. I think I have a much better idea of what I need to do now. Hopefully I can do it!
That's the spirit!