# Process the header while ($line = <>) { if ($line =~ m/^\s*$/) { last; # stop processing within this while loop, continue below } ... process header line here ... } ... processing for the rest of the message follows ... ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl