Check out example codes for "perl validate integer". It will help you in understanding the concepts better.

Code Example 1

# For Perl (language) only

# Headers to use
use Scalar::Util 'looks_like_number';

# syntax 

# example (copy-paste, and then run the following to see what happens)
use Scalar::Util 'looks_like_number';
my $iNum = "123";
if ( looks_like_number($iNum) ) {
	print "$iNum is a valid integer!" . "\n";
else {
	print "$iNum is NOT a valid integer!" . "\n";

Learn ReactJs, React Native from