SHARYANTO::Scalar::Util3pm
Scalar utilities
Usage
use SHARYANTO::Scalar::Util qw(looks_like_intlooks_like_floatlooks_like_real);say looks_like_int(10); # 1, isint() also returns 1say looks_like_int("1".("0" x 100)); # 1, isint() returns 0 heresay looks_like_int("123a"); # 0say looks_like_float(1.1); # 1say looks_like_float("1e2"); # 1say looks_like_float("-Inf"); # 1say looks_like_float(""); # 0# either looks like int, or floatsay looks_like_real(1); # 1say looks_like_real(1.1); # 1
Version
version 0.67
Functions
looks_like_int($arg) => BOOL
Uses Scalar::Util's "looks_like_number()" to check whether $arg looks like an integer.
looks_like_float($arg) => BOOL
Uses Scalar::Util's "looks_like_number()" to check whether $arg looks like a floating point number.
looks_like_real($arg) => BOOL
Uses Scalar::Util's "looks_like_number()" to check whether $arg looks like a real number (either an integer or a floating point).
Homepage
Please visit the project's homepage at <https://metacpan.org/release/SHARYANTO-Utils>.
Source
Source repository is at <https://github.com/sharyanto/perl-SHARYANTO-Utils>.
Copyright and license
This software is copyright (c) 2014 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.