CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [abs52] Number Comparison: Edit Log



ogit2
Novice

Mar 20, 2018, 8:06 AM


Views: 6075
Re: [abs52] Number Comparison

Hi

Are you trying to do a string comparison, string length comparison or number comparison? Can you confirm? In string comparisons lt, gt, eq, le, ge are used instead of symbols. However this will still gives the same result.

Also try this in Excel, and you will see the same result.



Code
#!C:\Perl\bin\perl.exe 

use strict;
use warnings;
my $hello = "384.99";
my $hello2 = "384.128";
if ( $hello ge $hello2 )
{
print "$hello newer than or same as wanted $hello2, not doing anything\n";
}



(This post was edited by ogit2 on Mar 20, 2018, 8:15 AM)


Edit Log:
Post edited by ogit2 (Novice) on Mar 20, 2018, 8:15 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives