Posted on 2005-02-16 02:06:52-08 by rcseege in response to 109
Re: use of uninitialized value

No further feedback? No matter... I'm guessing that you must be using the older version (0.01-0.02) because that's the only thing that makes sense after reviewing each release and checking out the line.

First of all, yes, this is a bug, and should be corrected. There are at least two ways in which it might be done, but first you should consider upgrading to 1.02 -- that is the newest version and the problem has been corrected (much of that section has been completely rewritten). Even should the following fixes work, I'm sure there are still one or two other bugs lurking in the older code.

You don't want to upgrade or patch the module:

Ensure that you always set the -validate option. Set it to "none" during creation if you don't wish to use validation.

Fixing the module itself:

The problem has to do with the -validate option not being initialized. The method in question can be fixed with the following:

my $mode = $cw->cget('-validate') || "none";

This will assume that "none" is a default value if nothing else is set. Possibly a BETTER fix would be to modify the code on line 207 instead to:

-validate => [qw/METHOD validate Validate none/],

This will ensure that -validate uses "none" as a default value if no other is set.

My advice: Upgrade to 1.02 if possible.

Rob
Direct Responses: 123 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.