open filehandle, >"/home/mj/newlogs"+a number+".log" print filehandle, $3 close filehandle