Justudo has asked for the wisdom of the Perl Monks concerning the following question:

Hi experts, I have 2 set of routines here, where in routine A i need to past the previous URL properties to routine B.
routine A (request_uri line works fine) --------- sub handler { my $r = shift; my $request_uri = param('request_uri') || ($r->prev ? $r->prev->uri : cookie('request_uri')); my ($ver_result, $ver_msg) = $authTool->verify($r->prev); routine B --------- # AuthTools::verify() # Call as: # ($result,$msg) = $authTool->verify($r) sub verify { my($self, $r) = @_; my %cookies = CGI::Cookie->parse($r->header_in('Cookie')); ...
This gives the following error in apache log : error Can't call method "header_in" on an undefined value at /app/routineB line 151.

Replies are listed 'Best First'.
Re: Apache handler passing
by edoc (Chaplain) on Jun 05, 2003 at 03:53 UTC

    It would seem that in routine A it's quite possible that $r->prev isn't set as you test it in assigning $request_uri but in the next line you pass $r->prev to verify without testing it at all. The error suggests that $r->prev is not set.

    cheers,

    J