in reply to Where am I going wrong?

If your code does not display the "Hydrophobic stretch found in:" message, then the input file could exist, but be empty. Or, the input file does not have a line beginning with >, then followed by a tab, then followed by VILMFWCA. Is there a tab? You could try:
if ($sequence =~ /(^>)\s*(VILMFWCA)/){

Is this a job for http://www.bioperl.org/wiki/Main_Page?

See also: How do I compose an effective node title?

Replies are listed 'Best First'.
Re^2: Where am I going wrong?
by lairel (Novice) on Oct 20, 2015 at 16:27 UTC

    I know the file isn't empty, I initially wrote the program to just print the file so I could see what it looked like. I made the change you suggested and didn't get any output still. The fasta file has header line then sequence line for each sequence, and I need the program to search the sequence for the desired code, then if the sequence is found, print the corresponding header, and then the sequence and location of the sequence