in reply to extracting specific information from a txt file

For reading sections it is often useful to set $/ (or $INPUT_RECORD_SEPARATOR if you use English;) to the delimiter text.

See perlvar.