Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: largest number inside array/hash

by DigitalKitty (Parson)
on Apr 06, 2004 at 21:47 UTC ( #343134=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    my @nums = sort { $a <=> $b } @array;
    
    print "The largest number is: $nums[$#nums]\n";
    
  2. or download this
    C:\>perl pg8.pl
    The largest number is: 218
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2021-04-12 06:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?