#!/usr/bin/perl use strict; use warnings; no warnings ("uninitialized"); my $id = 1001; if ($id =~ /^\d*$/) { print "Match\n"; } $id = undef; if ($id =~ /^\d*$/) { print "Match\n"; }