my $cq = new CGI; my $targ = $cq->param('target'); if(defined($targ)) { # User gave us a target name. Do the rename and tell the user all's good ... }