lenti240 [~/perltest]>more file.pl #!/opt/local/bin/perl -w # file.pl $filename = "tests.pep"; #open file and associate it with a "filehandle" open (PROTEINFILE, $filename); #while there are unread lines in PROTEINFILE #read one line and, if the first character is a ">", print it # regular expressions (regexps) are enclosed in / /s. # ^ in a regexp means first character # ^> means first character is a ">" while () { if (/^>/) { print $_; } } exit; lenti241 [~/perltest]>perl file.pl >A28086 Length: 104 >gi|79882|pir||B29504 hypothetical 18K protein (mer operon) - Staphylococcus aureus plasmid pI258 >ORF15 S. aureus pathogenicity island lenti242 [~/perltest]>