thx shmem, as i still new to perl, still trying to grasp the idea. As I had extracted this part of the problem frm the bigger program I m doing. Any chance you know of any idea to form vectors using perl? I am trying to do a program where I could be reading from various files to form vectors from these files after it is compared with a master keyword vector. thanks once again.