Again, where is the disconnect? What have you tried to do to combine the two? Is the interpreter outputting errors? Is the issue just that you are not familiar with Perl syntax? Post what you've done (even if it is just pseudocode) and we can work through it together. If you expect a monk to take two scripts you found on the internet and merge them for you, then the Your Work section of How (Not) To Ask A Question is very relevant.