Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: finding highest number

by Chief of Chaos (Friar)
on Dec 05, 2002 at 13:02 UTC ( [id://217746]=note: print w/replies, xml ) Need Help??


in reply to finding highest number

If you don't want to use sort, try this :
if (scalar(@numbers) > 0) { # compare only when array has entries my $highest = $numbers[0]; # set startvalue foreach my $compNum (@numbers){ # compare all numbers in array $highest = $compNum if ($compNum > $highest); } } else { # nothing to compare }
ps: code is not tested

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://217746]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found