Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

scalar::util::numeric(3pm) [debian man page]

Scalar::Util::Numeric(3pm)				User Contributed Perl Documentation				Scalar::Util::Numeric(3pm)

NAME
Scalar::Util::Numeric - numeric tests for Perl scalars SYNOPSIS
use Scalar::Util::Numeric qw(isnum isint isfloat); foo($bar / 2) if (isnum $bar); if (isint $baz) { # ... } elsif (isfloat $baz) { # ... } DESCRIPTION
This module exports a number of wrappers around perl's builtin "grok_number" function, which returns the numeric type of its argument, or 0 if it isn't numeric. TAGS
All of the functions exported by Scalar::Util::Numeric can be imported by using the ":all" tag: use Scalar::Util::Numeric qw(:all); EXPORTS
isnum isnum ($val) Returns a nonzero value (indicating the numeric type) if $val is a number. The numeric type is a conjunction of the following flags: 0x01 IS_NUMBER_IN_UV (number within UV range - not necessarily an integer) 0x02 IS_NUMBER_GREATER_THAN_UV_MAX (number is greater than UV_MAX) 0x04 IS_NUMBER_NOT_INT (saw . or E notation) 0x08 IS_NUMBER_NEG (leading minus sign) 0x10 IS_NUMBER_INFINITY (Infinity) 0x20 IS_NUMBER_NAN (NaN - not a number) isint isuv isbig isfloat isneg isinf isnan The following flavours of "isnum" (corresponding to the flags above) are also available: isint isuv isbig isfloat isneg isinf isnan "isint" returns -1 if its operand is a negative integer, 1 if it's 0 or a positive integer, and 0 otherwise. The others always return 1 or 0. SEE ALSO
o "type" in autobox o Data::Types o Params::Classify o Params::Util o Scalar::Util o String::Numeric VERSION
0.22 AUTHORS
o chocolateboy <chocolate@cpan.org> o Michael G Schwern <schwern@pobox.com> COPYRIGHT
Copyright (c) 2005-2010, chocolateboy. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. perl v5.14.2 2010-08-25 Scalar::Util::Numeric(3pm)

Check Out this Related Man Page

Task::Weaken(3) 					User Contributed Perl Documentation					   Task::Weaken(3)

NAME
Task::Weaken - Ensure that a platform has weaken support DESCRIPTION
One recurring problem in modules that use Scalar::Util's "weaken" function is that it is not present in the pure-perl variant. While this isn't necesarily always a problem in a straight CPAN-based Perl environment, some operating system distributions only include the pure-Perl versions, don't include the XS version, and so weaken is then "missing" from the platform, despite passing a dependency on Scalar::Util successfully. Most notably this is RedHat Linux at time of writing, but other come and go and do the same thing, hence "recurring problem". The normal solution is to manually write tests in each distribution to ensure that "weaken" is available. This restores the functionality testing to a dependency you do once in your Makefile.PL, rather than something you have to write extra tests for each time you write a module. It should also help make the package auto-generators for the various operating systems play more nicely, because it introduces a dependency that they have to have a proper weaken in order to work. How this Task works Part of the problem seems to stem from the fact that some distributions continue to include modules even if they fail some of their tests. To get around that for this module, it will do a few dirty tricks. If Scalar::Util is not available at all, it will issue a normal dependency on the module. However, if Scalar::Util is relatively new ( it is >= 1.19 ) and the module does not have weaken, the install will bail out altogether with a long error encouraging the user to seek support from their vendor (this problem happens most often in vendor-packaged Perl versions). This distribution also contains tests to ensure that weaken is available using more normal methods. So if your module uses "weaken", you can just add the following to your Module::Install-based Makefile.PL (or equivalent). requires 'Task::Weaken' => 0; SUPPORT
Bugs should be always be reported via the CPAN bug tracker at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Task-Weaken> For other issues,contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> SEE ALSO
Task, Scalar::Util, <http://ali.as/> COPYRIGHT
Copyright 2006 - 2011 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.16.3 2011-03-08 Task::Weaken(3)
Man Page