use strict; use warnings; use CGI; my $q = CGI->new(); my $id = $q->param('id') || 0; my $name = $q->param('name') || ''; my $all_valid = 1; # Apply your rules for parameter validation. # If some is not valid then $all_valid = 0 if(! $all_valid) { # log the information somewhere, file, DB ... # redirect print redirect(-uri => 'xyz.com/index.html', -status => 303 ); exit; } # all is well. Continue processing