Just for reference, here's some timing results on my machine for the following code snippet...
#!/usr/bin/perl -w
#Initialization
@vals = reverse "a".."daaaa";
#O(NlogN)
my $max = pop @{[ sort @vals ]};
#O(N)
#my $max = $vals[0];
#$max = ( $_ gt $max ) ? $_ : $max foreach @vals;
$e=@vals;
print "elements=$e max=$max\n";
Commenting out everything but the initialization section (i.e. not finding any maximum at all), this snippet executes in about 4.4 seconds on my machine. Using the sort to find the max, it takes about 6.2 seconds. Finally, using the linear method, it executes in about 5.1 seconds. So, for the 1,846,183 elements in this example, the sort method is about 2.5 times slower (6.2-4.4)/(5.1-4.4) than the linear search method. But the test is still dominated by just generating the large array. So you might not notice the efficiency gain if your data set is smaller than 1.8 million elements.
-- All code is 100% tested and functional unless otherwise noted.