Look, you need to read the whole prog, understand it and figure out where it's getting it's values from and why it has a problem aka debugging.
Give it a shot, and come back with qns if you don't understand stuff.
If you've never used Perl (which is what that code looks like), start here:
http://perldoc.perl.org/
HTH