I am trying to get Auth::Cookie to work and keep getting this error?

Can't call method "uri" on an undefined value at /path/login.pl line

This is on a solaris box, with Apache 1.3.28.

The code is pretty straight forward:

use CGI qw(:standard :html3);
my $r = Apache->request;
my $uri = $r->prev->uri;

print redirect("http://mydomain.org/cgi-bin/askforsurvey.pl?uri=$uri");

This same script works just fine on my test machine, but not on my
production box. My guess is that something in the environment/apache
compile is different. Does anyone have any pointers as to where I
should look to fix this problem?