in reply to Splitting outside comments

See perldoc -q comments for some cautionary explanation about why handling comments with a regex may not be a good idea (or at least may not be as simple as you expect). As well as an expression you can use to skip comments.

Caution: Contents may have been coded under pressure.