I fail to pinpoint a particular problem in your question. Is it the "how do I connect to the database" issue you have a problem with? Is it "how do I process records"? Is it "how do I write a Perl program"? Is it "please write a program for me?". Please elaborate. And tell us what you've done so far.
Comment on Re: Performance : process lakhs of database records
Currently i take nearly hundred thousands of record and load it in hash. After that compare the record values to another table. It leads to performance issue. Is there any efficient way to improve this.