in reply to Re^4: Any improvement over the code possible??
in thread Any improvement over the code possible??

OK. got it worked by using the below code: -

use Scalar::Util 'looks_like_number'; my $result = looks_like_number('abc');

Do we have to import functions like this only? Else I have to do it for every function I import??

Replies are listed 'Best First'.
Re^6: Any improvement over the code possible??
by toolic (Bishop) on Sep 21, 2012 at 17:47 UTC
    Different modules have different requirements, which are usually in the docs:
    By default Scalar::Util does not export any subroutines.

    So, for this module, you must import explicitly. See also perldoc -f use

      Thanks toolic for a valuable information.. :)