use strict; my @loglist; #put all *.log files in the array @loglist = <./*.log>;