use List::Util 'reduce'; my $newest = ( reduce { $a->[1] < $b->[1] ? $b : $a } map { [ $_, (stat)[9] ] } glob '/path/to/*.log' )->[0];