in reply to variables in global match in regex

While you are at it, be sure to get into the habit of including the lines use strict; use warnings;. They'll make you do a little bit of work up front in code-cleanliness but they pay off in spades when they prevent a number of common bugs from occurring.