if (condition) { print $q->redirect(-uri=>'http://www.mysite.com/xyz.html'); } else { print $q->redirect(-uri=>'http://www.mysite.com/abc.html'); }