You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Vivek Khera <kh...@kcilink.com> on 2003/09/29 21:52:07 UTC
Apache::AuthCookie: undefined value in subroutine call -- solved
I've had this long standing warning in my application:
Use of uninitialized value in subroutine entry at
/var/vkmlm/perllib/MLM/MLMhandler.pm line 80
And this is what the line was:
my $subr = $r->lookup_uri($uri);
Naturally, $uri is *always* defined, and the warning only shows up
some of the time.
I finally tracked down the right conditions to repeat the warning at
will, which let me find the actual cause. It turns out to be the
method Apache::AuthCookie->recognize_user which has a return call that
does not return a status:
my ($cookie) = $r->header_in('Cookie') =~ /${auth_type}_${auth_name}=([^;]+)/;
$r->log_error("cookie ${auth_type}_${auth_name} is $cookie") if $debug >= 2;
return unless $cookie;
changing the last line to
return DECLINED unless $cookie;
seems to do the right thing, and gets rid of that pesky warning.
Finally, I can have an error log that logs only real errors ;-)
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org