Just a non-RE note. The -w is telling you, actually warning you, that you
haven't declared the variables before using them. It is just a warning
and doesn't prevent the script from running.
As Adam pointed out the -w is always good to use. So is
use strict. I should have added that since you don't
declare the variables before using them, their values will be set
to null. Since the RE doesn't assign any values to the
variables, they get the null value assigned to them.