1Compare(3) User Contributed Perl Documentation Compare(3)
2
3
4
6 Number::Compare - numeric comparisons
7
9 Number::Compare->new(">1Ki")->test(1025); # is 1025 > 1024
10
11 my $c = Number::Compare->new(">1M");
12 $c->(1_200_000); # slightly terser invocation
13
15 Number::Compare compiles a simple comparison to an anonymous subrou‐
16 tine, which you can call with a value to be tested again.
17
18 Now this would be very pointless, if Number::Compare didn't understand
19 magnitudes.
20
21 The target value may use magnitudes of kilobytes ("k", "ki"), megabytes
22 ("m", "mi"), or gigabytes ("g", "gi"). Those suffixed with an "i" use
23 the appropriate 2**n version in accordance with the IEC standard:
24 http://physics.nist.gov/cuu/Units/binary.html
25
27 ->new( $test )
28
29 Returns a new object that compares the specified test.
30
31 ->test( $value )
32
33 A longhanded version of $compare->( $value ). Predates blessed subrou‐
34 tine reference implementation.
35
36 ->parse_to_perl( $test )
37
38 Returns a perl code fragment equivalent to the test.
39
41 Richard Clamp <richardc@unixbeard.net>
42
44 Copyright (C) 2002 Richard Clamp. All Rights Reserved.
45
46 This module is free software; you can redistribute it and/or modify it
47 under the same terms as Perl itself.
48
50 http://physics.nist.gov/cuu/Units/binary.html
51
52
53
54perl v5.8.8 2002-10-25 Compare(3)