the problem is that you are using numeric comparison (==) when you need string comparison (eq), so the contents of $q->param('userid') always evaluates to true regardless if it's empty or not. change your code like this:
if ($q->param('userid') eq '') { $self->_create_user(); } else { $self->_update_user(); }
see also the tutorials here on PerlMonks that cover the various ways Perl test for true/false.
also here is how you could debug input parameter passing in your CGI::Application modules:
sub maintain_user { my $self = shift; my $q = $self->query; use Data::Dumper; return Dumper $q; }
In reply to Re: CGI:Application and HTML::Template parameter passing
by arpad.szasz
in thread CGI:Application and HTML::Template parameter passing
by emgrasso
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |