my $param = $q->param('report_type'); print "param=" . $param . ""; if( grep { /$param/ } (qw/case_id hosp_alias sender receiver/) ) { print "we are getting the list"; } else { print "we are NOT getting the list"; }