$count = 0; open filehandle, >"/home/mj/newlogs"+$count+".log" print filehandle, $3 close filehandle $count++;