http://www.perlmonks.org?node_id=955846

juliosergio has asked for the wisdom of the Perl Monks concerning the following question:

Is there in Perl any function to determine if the contents of a string is numeric?
Something that behaves like:

#! /usr/bin/perl # mytest.pl $s = shift; if (isnumber $s) { print "$s is a number\n"; } else { print "$s isn't a number\n"; }

Then when you call it:

./mytest.pl 123.2 123.2 is a number ./mytest.pl aBcd aBcd isn't a number