Of course on a unix filesystem the colon ":" could potentially be part of a file name so tokenising the string with a "split" wouldn't work reliably. I'm a Perl beginner but I would be looking at using a regular expression to solve this. I know how I would write it in a sed script :-)

the ":40:" or even the "THIS will be removed in a future release. Use THAT without ERROR instead" could potentially be part of a file name, so how would you reliably identify the SOMENUMBER1 and SOME TEXT IN HERE that you want?