http://www.perlmonks.org?node_id=19621


in reply to Acolyte needs regex help

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.

Update:
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.

Replies are listed 'Best First'.
RE: RE: Acolyte needs regex help
by Adam (Vicar) on Jun 23, 2000 at 21:46 UTC
    Yes, but if look at the last line of the post, "my problem is that it tells me all my variable are uninitialized and if I print them they are all null values." The problen is that they are null values. This is a great example of why you should use -w, it lead the programmer to the heart of the problem very quickly.