yup, that was it.  Thanks $Bill, and all others who mailed me privately.
I swear I re-read the man page several times and didn't see it.  
I do now though :-)

cheers for taking the time all.

John Constable Technical Support Specialist
Cambridge Positioning Systems Ltd 62-64 Hills Road, Cambridge, CB2 1LA
Tel: 01223 326900, Fax:01223 326901 Email: [EMAIL PROTECTED]
Cursor  and Coverge  are trademarks of Cambridge Positioning Systems Limited
 


> -----Original Message-----
> From: $Bill Luebkert [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 15, 2002 3:38 PM
> To: John Constable
> Cc: Perl - Activeperl Mailing List (E-mail)
> Subject: Re: comparing numbers
> 
> 
> John Constable wrote:
> 
> > This email is subject to the disclaimer set out below
> > *****************************************************
> > 
> > Hi Guys,
> > 
> > first of all, I hope I'm posting to the right list, if not, 
> my apologies
> > (while I'm apologising, let me apologise for my company 
> disclaimer, which I
> > cant change..:-).
> > 
> > Its a basic perl question, but I'm a relative newbie, so 
> bear with me if the
> > answer is obvious.. 
> > I'm running a for loop that compares two variables.  if one 
> if bigger than
> > the other, it gets made the new "big" variable, until the array is
> > exhausted..  the problem is, perl seems to be treating the 
> numbers rather
> > weird.."11" for example, seems to be treated as "1", so is 
> less than most
> > numbers etc...
> > 
> > I've posted the code below, can you tell me what I'm doing wrong?
> > 
> > $check = 0;
> > $biggest = 0;
> > 
> > for $check (@results) {
> >         if ($check gt $biggest) {
> 
> 
> 
> Try a numerical comparison:
> 
>       if ($check > $biggest) {
> 
> 
> >                 $biggest = $check;
> >         }
> > }
> > print "Largest Die roll is $biggest\n";
> > 
> > and the array (in this case) was: 
> > @results = (
> >              '7',
> >              '7',
> >              '5',
> >              '11'
> >            );
> > 
> > my printing output gives me:
> > Largest Die roll is 7
> > 11 5 7 7
> 
> 
> 
> -- 
>    ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
>   (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
>    / ) /--<  o // //      http://dbecoll.tripod.com/ (Free 
> site for Perl)
> -/-' /___/_<_</_</_     Castle of Medieval Myth & Magic 
http://www.todbe.com/


THIS E-MAIL MAY CONTAIN INFORMATION THAT IS CONFIDENTIAL AND/OR LEGALLY PRIVILEGED. IF 
YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DO NOT READ IT, DELETE IT IMMEDIATELY AND 
INFORM CAMBRIDGE POSITIONING SYSTEMS LIMITED BY TELEPHONING +44 (0)1223 326900.

This Email has been checked for viruses but it is your responsibility to conduct your 
own virus checks on all parts of it.

Cambridge Positioning Systems Limited, 62-64 Hills Road, Cambridge, CB2 1LA, is 
registered in England under company number 2808344.


***************************************************************************

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to