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


in reply to General Question on parsing a variable

You probably want to split on \nend\n or so, and print an item if it matches your regex.

At least I guess that's what you want, since you didn't actually ask a question.