Thanks for your suggestion Roger. Unfortunately, it hasn't done the trick, it will still print the contents of the initial URL and then start giving the uninitialized value warning message. You forgot a ) after the regex in the $stripped_html... var (am mentioning this just to make sure you didn't do it for a special reason). I believe the problem is that for some reason the data will not be written in my two arrays but i can't understand why that is.