Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

number::compare5.18(3) [mojave man page]

Number::Compare(3)					User Contributed Perl Documentation					Number::Compare(3)

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 v5.18.2 2011-09-21 Number::Compare(3)

Check Out this Related Man Page

Number::Compare(3pm)					User Contributed Perl Documentation				      Number::Compare(3pm)

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 v5.12.4 2011-09-21 Number::Compare(3pm)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do I test whether that is a binary file?

Hi, I tried locating my book for the keyword to test whether the file is a binary file but I can't find it under test. Anyone any idea what the key letter is ?:( (8 Replies)
Discussion started by: scmay
8 Replies

2. UNIX for Dummies Questions & Answers

Date Compare

Hi, Is there any date compare functionality in unix? thanks and regards vivek.s (10 Replies)
Discussion started by: vivekshankar
10 Replies

3. Shell Programming and Scripting

Compare and extract

Compare two files, search for data from position 1-6 if both matches then i need to extract those records only from file A cat File A A37985LUNGIUF7845049530113 F41604CHACAMA286000004371 cat File B C26344 F41604 o/p F41604CHACAMA286000004371 (8 Replies)
Discussion started by: ford2020
8 Replies

4. Shell Programming and Scripting

Compare two files and print the two lines with difference

I have two files like this: #FILE 1 ABCD 4322 26485 JMTJ 5311 97248 XMPJ 4321 58978 #FILE 2 ABCD 4321 26485 JMTJ 5311 97248 XMPJ 4321 68978 What to do: Compare the two files and find those lines that doesn't match. And have a new file like this: #FILE 3 "from file 1" ABCD 4322 26485... (11 Replies)
Discussion started by: kingpeejay
11 Replies

5. Shell Programming and Scripting

Compare arrays (perl)

Hi, my first post here! Description of my problem: I have one txt-file with six rows and each row contains seven numbers seperated with whitespaces. I want to: Compare one array with seven numbers with each row of numbers in the txt-file. I have managed to compare one array with... (6 Replies)
Discussion started by: mjoh
6 Replies

6. Shell Programming and Scripting

How to Compare 2 Strings ?

Hello , I want to Compare with 2 strings and get if they are True or not please would like some help on this #!bin/ksh echo "Enter Name 1" read Name1 echo "Enter Name 2" read Name2 echo "------------------------" echo "First Name: $Name1" echo "Second Name: $Name2" echo... (25 Replies)
Discussion started by: shatztal
25 Replies

7. Shell Programming and Scripting

How to Read & Compare Two Files

Hi forumers, How is it going. Ok i need some advice on the following problem. I have 2 files to read and compare data.FileA and FileB. FileA will return either status 1 or 0. FileB on the other hand is trickier and has the following details:- Count DeviceID CurrentStatus ... (7 Replies)
Discussion started by: prakash1111
7 Replies

8. Shell Programming and Scripting

Compare float value with single decimal

#!/bin/bash filter_file=/export/home/alvin/test.txt range1_count=0 range2_count=0 categorized(){ value=$1 if # range 5.1 to 10.0 then range1_count=`expr $range1+ 1` elif # range 5.1 to 15.00 then range2_count=`expr $range2+ 1` fi } #read txt file which contain lines of... (8 Replies)
Discussion started by: alvin0618
8 Replies

9. Shell Programming and Scripting

String variable to numeric conversion in perl

Hi guys I am having this strange issue.Well my requirement is like below Compare two values between flat file and oracle DB Via perl script I am easily getting the rowcount Now I connect sql plus via perl and the column value that returns is string my $sqlplus_settings = ''; my... (7 Replies)
Discussion started by: Pratik4891
7 Replies

10. Shell Programming and Scripting

Compare two files (Many to one comparison)

Hello, I am having output shown below names will change and can show different result and i want to compare with the checklist this file will not change it is standard settings. If there is some discrepancy than the complete line of output should be shown with name. I tried to use below... (10 Replies)
Discussion started by: rajjev_saini123
10 Replies

11. What is on Your Mind?

Healthcare.gov, ugh!!

I had to vent somewhere where people would understand. The site is still driving me mad. I'm at McMurdo Station, Antarctica, and the satellite bandwidth is generally fairly adequate. I actually completed the application Nov 4th in just under 3 hours I believe. But I removed it thinking it was... (7 Replies)
Discussion started by: neutronscott
7 Replies

12. Shell Programming and Scripting

Compare value in the last occurrence for each id

Dear Gents, Please can you help me. I have a file with multiple values called ID ID ( columns 11-24) INDEX ( column 26 ) STATUS ( columns 91-92) The ID can be repetead many times to diference each one there is a value called INDEX which difference each time, it increase if the ID is... (10 Replies)
Discussion started by: jiam912
10 Replies

13. UNIX for Dummies Questions & Answers

Compare

(8 Replies)
Discussion started by: loktamann
8 Replies

14. Shell Programming and Scripting

Compare 2 Strings

I have 2 values V_1_4_4_b1 and V_1_5_1_RC_b1. I would need to compare them and determine if the 1st value is greater, less or equal than the 2nd value. The result should need to have a return value. I have below code in bash function but it seems it is not comparing it correctly. Any help will... (8 Replies)
Discussion started by: aderamos12
8 Replies

15. UNIX for Beginners Questions & Answers

Compare first column from two csv files with greater than or equal, and less than

I have two csv files of different sizes. The output file needs to have file1 contents on top of file2 contents where file2 col1 is >= to file1 col1, and file2 col1(same value) is < file1 col1 (next value). So basically, some file2 rows will be matched to the same file1 row because it is the closet... (7 Replies)
Discussion started by: aachave1
7 Replies