Just saying you need to parse it isn't descriptive enough. What do you want to do? Substitute over the text in different levels? Put it all into some kind of tree structure?
The most flexible solution is to use something like Parse::RecDescent.
Comment on Re: Need advice (module) to parse nested IF/ELSIF..