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
6.

This is on a solaris box, with Apache 1.3.28.

The code is pretty straight forward:
#!/usr/bin/perl

use CGI qw(:standard :html3);
my $r = Apache->request;
$r->status(200);
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?

thanks
chad