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:
gt lt... ?

 



DippinPete
Deleted

Jan 16, 2001, 1:37 PM

Post #1 of 2 (225 views)
gt lt... ? Can't Post

Hi.
Perl Question...

Why wouldn't

if ($coupon_id ne "" && $coupon_style eq "B" && $subtotal gt $snooker)

work?

if ($coupon_id ne "" && $coupon_style eq "B")

work fine. $subtotal and $snooker both have values and work fine if you do a print "$subtotal and $snooker";

So what gives?

Pete





Jasmine
Administrator / Moderator

Jan 16, 2001, 2:55 PM

Post #2 of 2 (223 views)
Re: gt lt... ? [In reply to] Can't Post

Assuming $subtotal is a number, it sounds like you're using the incorrect comparison operator:

gt and lt are for textual comparisons
> and < are for numeric comparisons

> is greater than
>= is greater than or equal to
< is less than
<= is less than or equal to


 
 


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

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