#!/usr/bin/perl -w # finding max/min example #---------------------------------------------------- @data = qw(17 4 20 91 13 43 23 49 29 15 98 55 63 72 36 29 11 84 86 22 4 17 33 48 5); # find the maximum in the array $max = -9999999; foreach $k (@data) { if($k > $max) { $max = $k; } } print "the maximum value is $max\n"; exit;