while (<$fh>) { ..read/process file header last if /End-Of-Header/; } while (<$fh>) { ...read/process file body }