Hum, I was just going to tell something to the effect that your script was not very useful, but as I hit the reply button, I just saw your edited version. This is indeed much more to the point.
I tested it then noticed that he was indeed trying to search and replace. Did a ninja edit ; I was also about to change ARGV's to <STDIN>'s and chomp them as well.