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) {
$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
cheers 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
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