Thankyou for the explanation, the rename function was not working as i had not closed the filehandler, i did not notice it at first but then figured it out.
i was actually trying to build a small parser for the file. and perl was the easiest scripting language to learn. i went on to extract some parameters at first and try to run the program, will try to continue with more parameters.
thank you again :)