Seriously? What's stopping you making the effort of learning what each line does, and adding comments yourself? Your post history looks like you're asking for people here to deliver something you're being paid to deliver.
Thanks for your comment marto. Well if i could have understand Graff script at first. I wouldn't be continuing to write comments. Secondly am still very new to perl. so i asked him to put a breif comments so that it will help to understand what it does.
If you can't answer then please don't comment what ever you think, have a bit of sense or think before what you say. I agree you might be a great perl monk that's doesn't mean every one will be on your level. If you can't explain that's fine with me but don't ever write/think comment what comes to your mind. It my kind advice
WIth all due respect, marto's response was reasonable and appropriate. I considered adding more comments to the code I posted above, but then I realized that I don't know enough about your level of knowledge to determine what I should add to be most helpful to you.
I also reflected on my own experience learning perl as a new language (way back in 1995). Someone handed me a bunch of perl scripts that were supposed to work together as a pipeline to do some really intricate text processing, and I was supposed to adapt it to handle a larger range of input data. I spent at least half of my time referring back to "perldoc -f ..." to look up the detailed (and quite clear) descriptions of perl functions (in fact, I often ran "perldoc perlfunc" to see them all), as well as "perldoc perlsyn", "perldoc perlre" and so on.
That, along with stepping through in the debugger in order to see what a given function returned for a given input, allowed me to get my task done reasonably well. I highly recommend that approach. (Bear in mind that the code I posted might not do things the way you want them to be done.)
And now that we have Data::Dumper, using the debugger is even better - just add use Data::Dumper 'Dumper'; at the top, and as you step through you can just do p Dumper($some_ref) or p Dumper(\@some_array) and so on, to see what's happening.