[Bioperl-l] new-person question

Beth Chaplin bchaplin@hsph.harvard.edu
Sun, 24 Sep 2000 15:38:06 -0400 (EDT)


I am just learning perl, and am trying to write a program that will read
in a file of sequences in Fasta format.

>title
sequence...
>title
sequence...

I have a loop that takes each line, and if the line starts with '>',
should store that line in an array that will contain only sequence names.
However, the '>' is causing problems. The coding is:

while (<>)
{
        $templine = $_;
        if ($templine =~ /\b>/)
        {
                other stuff;
        }
}

and it works for perfectly if I use a character, such as '>', but not with
'>'. I tried putting a backslash (in the code) before the >, but that
didn't help.

If you have time to answer, thanks. If this question is too basic, or in
any way an inappropriate posting for this mailing list, please let me
know.