in reply to parse from last occurence of pattern match
You might want to take a look at File::ReadBackwards, and see if it will suit your purposes.