Filehandles

Changed from bare handle (DIR) to variable ($dir).