#! usr/bin/perl use warnings; use strict; my @allrecords; my $record; my $beginning_annotation; my $ending_annotation; my $alignment_section; unless (open (BLAST, "result.fasta")){ print "Can not open data file \n"; exit; } $/ = "BLASTP 2.2.3 [Apr-24-2002]"; @allrecords = ; foreach $record (@allrecords){ ($beginning_annotation, $ending_annotation, $alignment_section, $record) = @_; ($$beginning_annotation, $alignment_section, $$ending_annotation) = ($record =~ /(.*^ALIGNMENTS\n)(.*)(^ Database:.*)/ms); print $beginning_annotation; } exit;