afarber has asked for the wisdom of the Perl Monks concerning the following question:
Does anybody please have an advice on how to get rid of the warnings Use of uninitialized value in pattern match (m//) without (ab)using the no warnings qw(uninitialized);?
I have a habit of untainting input data this way:
$user = $1 if $query->param('user') =~ /(\w{3,12})/; $pass = $1 if $query->param('pass') =~ /(\w{8})/; ..... unless ($user and $pass and ...) { print $query->start_form(), ... } else { # do the real work with data }
(for example see my full script for adding new users to AD and NIS) and thus I can't set $query->param('blah'); to an empty string '' before I try to match it.
Thank you for your wisdom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI.pm and Use of uninitialized value in pattern match
by Corion (Patriarch) on Jan 21, 2009 at 14:29 UTC | |
|
Re: CGI.pm and Use of uninitialized value in pattern match
by jeffa (Bishop) on Jan 21, 2009 at 14:26 UTC | |
|
Re: CGI.pm and Use of uninitialized value in pattern match
by andye (Curate) on Jan 21, 2009 at 19:01 UTC | |
by afarber (Initiate) on Feb 27, 2009 at 14:05 UTC | |
|
Re: CGI.pm and Use of uninitialized value in pattern match
by Your Mother (Archbishop) on Jan 21, 2009 at 17:38 UTC | |
by Jenda (Abbot) on Jan 21, 2009 at 23:29 UTC |