#!/usr/bin/perl use strict; use warnings; my $filename = "record.gb"; open my $fOut, '>', $filename or die "Failed to create $filename: $!\n"; print $fOut <}; #to seperate the annotation from sequence $record =~ /^(LOCUS.*ORIGIN\s*\n)(.*)\/\/\n/s or die "Malformed record '$record'\n"; my ($annotation, $dna) = ($1, $2); print "$annotation, $dna\n";