if ($vlan_number =~ m|^\d+$|) { # Compliant - numeric only }else{ # Something Not completely numeric - display error. }