@hostnames = qw(baloo beast belle chip cogsworth lefou potts); my $timestamp=$ARGV[0]; for ($c=0; $c<@hostnames; $c++){ my $logpath = "/archive/$hostnames[$c]/www/logs/access_log.$timestamp"; #print "$logpath\n"; open (LOGS,"$logpath") || die "cant open $logpath\n"; while (){ regex{ get valuable data here; } }