in reply to I still can't get only the necessary lines from the file.

* is a metacharacter. Try escaping it in your regexps:
if (/START context/ .. /\* End Context \*/) { print unless /START context|\* End Context \*/; }
Also, note that your data says "Exit" but your code looks for "End".