in reply to Molecular weight of Protein

Or everything until the first white space:

my $header = $1 if /^([^\s]+)/;