in reply to Looping through Hash Function

Since you do not reference $k inside the while loop, nothing inside the while loop will change for each iteration, hence you will get the same output over and over. If you change the contents of the while loop so that they only refer to $k, you might have more success.