@thefiles= readdir(IMD) or die "can't readdir: $!";