#!/usr/bin/perl -w use strict; #use beginperlforbioinfo; my $annotation = ''; my $dna = ''; my $record=''; my $filename = "record.gb"; my $save_input_separator = $/; unless (open(GBFILE, $filename)) { print "Cannot open Genbank file "; exit; } #use the input seperator //\n to read a entire file to scalar $/ = "//\n"; $record= ; #print $record; #always to remember to reset the file input seperator $/= $save_input_separator; #to seperate the annotation from sequence ($annotation, $dna) = ($record =~ /^(LOCUS.*ORIGIN\s*\n)(.*)\/\/\n/s); print "$annotation, $dna\n";