http://www.perlmonks.org?node_id=1058148


in reply to Re^2: How to extract certain range of text and display it?
in thread How to extract certain range of text and write into another file?

CountZero's advice is more than just "setting $/". You have to
  1. define $/ before reading your file
  2. of course, spell your record separator correctly, as noted by jakeease
  3. change your logic accordingly, because a "record" now contains multiple lines (those belonging to one name)