"I have limited time (2 hours left) to deadline"
By me, that gets an almost-automatic - - for trying to set a time limit on the free help you're seeking. Suggest you start by reading PerlMonks FAQ.
This is NOT code-a-matic. This is not a free code-writing service. This is a spot where those who offer help greatly appreciate some sign that you've made some effort yourself, and are interested in learning, as opposed to merely tapping their brains without compensation... to keep your job, grade-point average, or whatever is imposing your deadline.
If you didn't program your executable by toggling in binary, it wasn't really programming!