in reply to Regexp problems

I would be wary of depending on a regex that expects a rigid order of tag attributes. BrowserUk's comments about the quality of the data are well taken, and I would just modify his approach so that you can simply take any tag and parse it into its various attributes, using a hash to keep track of them, so you don't need to worry about what order they happen to have been written in:
if ( /<gene_seq ([^>]+)>/ ) { my $attribString = $1; # The challenge is to split the line properly into key/val # pairs; first, let's get rid of boundary stuff that might # get in the way: $attribString =~ s{^\s+}{}; # initial whitespace $attribString =~ s{[/\s]+$}{}; # final whitespace and/or "/" # now split into key,val pairs, assuming that " = " falls # between attrib name and attrib value, while the boundary # between a value and the next attrib name is whitespace # preceded by double-quote and followed by alphanumeric: my %attribHash = split( /\s+=\s+|(?<=\w\")\s+(?=\w)/, $attribStrin +g ); # That's it; now work with the keys and values of that hash...
Note that this preserves the double quotes around attrib values. If there's a flaw in the data, like the one that BrowserUk pointed out, this will produce a very confused result -- which you would detect if you happened to find double-quote characters in any of the hash keys. So you could follow that split with:
die "Bad xml tag:\n$_\n" if ( grep( /\"/, keys %attribHash );