#!/usr/bin/perl while(<>){ /^.*<\/name>/ or next; $_ =~ s///; $_ =~ s/<\/name>//; print $_; } #Run this by typing # perl list.pl protein.txt #at the command prompt. #Alternatively, # ./list.pl protein.txt #will work if list.pl is executable. #The while(<>) automatically processes whatever #file is supplied at the command line. #The line: # /^.*<\/name>/ or next; #simply skips all lines that don't match #that pattern.