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


in reply to A function to determine if a string is numeric

Scalar::Util::looks_like_number

This is also a FAQ: perldoc -q number

use warnings; use strict; use Scalar::Util qw(looks_like_number); my $s = shift; if (looks_like_number($s)) { print "$s is a number\n"; } else { print "$s isn't a number\n"; }

Replies are listed 'Best First'.
Re^2: A function to determine if a string is numeric
by juliosergio (Sexton) on Feb 24, 2012 at 00:56 UTC

    Hey! Thanks!
    -Sergio