in reply to parsing using metacharacters

Well, I'll guess that you already have your table in place and you know what data goes into what columns, etc... As for splitting up the data stream, something like this, maybe? (untested)
{ local $/ = "\$\$\$\$\n"; # apparent record delimiter while (<>) { my @lines = split( /\n/ ); my %fields = (); while ( @lines ) { $_ = shift @lines; if ( /^> <([^>]+)/ ) { my $fldname = $1; $fldname = "MolName" if ( $fldname eq '$NAM' ); $fields{$fldname} = shift @lines; } } # do something to put %fields into mysql... } }
That assumes that all the values you want (following the lines that start with ">") are really all single-line values, as shown in your brief example. Note that I change the "$NAM" string into something that's less likely to get you into to trouble elsewhere. =)