Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Number::Compare

Name Number::Compare
Version 0.03
Located at /usr/local/share/perl5
File /usr/local/share/perl5/Number/Compare.pm
Is Core No
Search CPAN for this module Number::Compare
Documentation Number::Compare
Module Details Number::Compare

NAME

Number::Compare - numeric comparisons


SYNOPSIS

 Number::Compare->new(">1Ki")->test(1025); # is 1025 > 1024
 my $c = Number::Compare->new(">1M");
 $c->(1_200_000);                          # slightly terser invocation


DESCRIPTION

Number::Compare compiles a simple comparison to an anonymous subroutine, which you can call with a value to be tested again.

Now this would be very pointless, if Number::Compare didn't understand magnitudes.

The target value may use magnitudes of kilobytes (k, ki), megabytes (m, mi), or gigabytes (g, gi). Those suffixed with an i use the appropriate 2**n version in accordance with the IEC standard: http://physics.nist.gov/cuu/Units/binary.html


METHODS

->new( $test )

Returns a new object that compares the specified test.

->test( $value )

A longhanded version of $compare->( $value ). Predates blessed subroutine reference implementation.

->parse_to_perl( $test )

Returns a perl code fragment equivalent to the test.


AUTHOR

Richard Clamp <richardc@unixbeard.net>


COPYRIGHT

Copyright (C) 2002,2011 Richard Clamp. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


SEE ALSO

http://physics.nist.gov/cuu/Units/binary.html

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024