#!/usr/local/bin/perl use strict; my $str; # holds the records #loop through the data while () { chomp; # kill newlines if (m!//!) { # we have a record my ($title,@flags) = split(m!/!,$str); # break out the fields(/ delimited) $title =~ s/\s+/ /g; # kill extra whitespace print "References:$title\n"; # print the title foreach (@flags) { # loop through the fields my ($key,$value) = split(/=/); # split into pairs $value =~ s/\s+/ /g; # kill extra whitespace print ucfirst($key)."\t$value\n"; # print each one } print "\n"; $str = ""; # zero the input buffer } else { $str .= " " . $_; # accumulate data } } __DATA__ TITLE An excitatory scorpion toxin with a distinctive feature: an additional alpha helix at the C terminus and its implications for interaction with insect sodium channels /interaction_site="Q8, N9, Y10, N11, C12, F17, W38, R58, V59 and K62 form the putative bioactive surface in mature toxin (Zilberberg et al., 1997)." /channel="Sodium channel" /target_cell="Insect specific (Excitatory)" /c_end="Free" // TITLE Cloning and Sequencing of an Excitatory Insect-Selective Neurotoxin BmKIT cDNA from Buthus martensii Karsch /interaction_site="Sequential deletions of C-terminal residues suggested Ile73 and Ile74 for toxicity. {Oren et al., 1999}" /channel="Sodium channel" /c_end="Free" //