use strict; sub max_number { my$current_max=shift@_; foreach(@_){ if($_>$current_max){ $current_max=$_; } } $current_max; } my@number=qw/1 2 3 4 6 5 7/; my$max= max_number(1,2,4,5); my$max1= max_number(@number); print"The max number is :$max\n"; print"The max number of \@number :$max1\n";