fixed replace_line function. seemed to be an issue with perl cmd line args