my $action = $query->param('ACTION'); unless(defined($action)) { $action = 'default'; } #### if($action eq 'delete') { $confirmed = $query->param('CONFIRMED') if($confirmed eq 'yes') { # do stuff } else { # do other stuff } }