Just as a general comment: Most monks around here don't respond very favourably to people copying and pasting Perl code they have found somewhere on the web without putting any effort into trying to understand at least the bare minimum of it themselves. You should be able to answer most of your questions after spending about 1 - 3 hrs on some basic Perl tutorials (depending on your background in other programming languages). If you have never done any programming before, start with the llama book ... it is great fun to read and will get you a long way towards answering all the questions you asked. It may only take you a little longer.
Good luck!
P. S.: And yes, this is probably one of my less helpful posts in this forum.
I realised it wouldnt be the most insighful post out there,thats what the err refers to... I guess I was a bit vague myself as I do understand a few things and have put in some effort; I just have an old script that does some batch text process and could save me quite a few hours on VB if only I knew a few more things. So I thought it couldnt hurt to ask. Anyway I now realise my post was quite rude so sorry for that. Thank you for you wisdom.