print Dumper sub { local $/ = '>'; my( $fh, %recs ) = shift; while( <$fh> ) { if( my($k,$v) = / ^(\N+)\n # Capture the key. ([CTGA]+)$ # Capture the value. /mx ) { $recs{$k}=$v; } } return \%recs; }->(\*DATA);