in reply to execute loop code for every occurence of regex

It appears ikegami has the right answer above. I just wanted to express one of my favorite hobbyhorses: "Don't use a regex when a simple string compare will suffice." Determining whether $line starts with .949. can be done with a simple:

if (substr($line, 0, 5) eq '.949.') { # and so on