I spent so many hours on this single issue and so many hours total with the perl today that no, I am not sure I am running the code I posted anymore. I have a string with multiple "a href" and I want to replace each one of them with different urls. I have a feeling like the while loop is causing some problem here