Gossamer Forum
Home : General : Perl Programming :

compare numbers

Quote Reply
compare numbers
Ok I am defeated , I have tried this for over a week and failed ...so please someone tell me why ?

$diskmb_flopdate ="2006";
if ($diskmb_flopdate < 2004) {
}&asub;
exit;

This should run onto the next print" statment : but its not .

I tried an else {..... and I tried another 'if statment in reverse added below to do the opposite ie ;
if ($diskmb_flopdate > 2004) {
}& a different sub ;
exit;

I am actually trying to compare one number against another (yeah you guessed it ('a years date') to divert to either the correct sub or print" statement , if the year is more (a higher number 2006 , the code should go one place and if its less 2003 then it should go elsewhere .
Subject Author Views Date
Thread compare numbers classca 11643 Jun 18, 2004, 3:25 PM
Thread Re: [classca] compare numbers
Andy 11468 Jun 19, 2004, 1:24 AM
Thread Re: [Andy] compare numbers
classca 11490 Jun 19, 2004, 2:05 AM
Thread Re: [classca] compare numbers
Andy 11458 Jun 19, 2004, 2:09 AM
Thread Re: [Andy] compare numbers
classca 11496 Jun 19, 2004, 6:02 AM
Thread Re: [classca] compare numbers
Andy 11504 Jun 19, 2004, 6:05 AM
Thread Re: [Andy] compare numbers
classca 11489 Jun 19, 2004, 7:45 AM
Thread Re: [classca] compare numbers
Andy 11461 Jun 19, 2004, 10:02 AM
Post Re: [Andy] compare numbers
classca 11426 Jun 19, 2004, 12:39 PM
Thread Re: [Andy] compare numbers
classca 11456 Jun 20, 2004, 6:16 AM
Thread Re: [classca] compare numbers
CrazyGuy 11414 Jun 22, 2004, 1:57 AM
Thread Re: [CrazyGuy] compare numbers
Andy 11440 Jun 22, 2004, 4:33 AM
Post Re: [Andy] compare numbers
CrazyGuy 11402 Jun 22, 2004, 5:01 AM