if( grep( $_ !~ /^\d+$/, @{$INPUT{'checked_ids'}) ){
# you have bad data
}
####
my @ids = split (/, +/, $INPUT{'checked_ids'});
# now check @ids w/grep() using the method above
####
if( $INPUT{'checked_ids'} !~ /^(\d+(, +)?)+$/ ){
# you have bad data
}