in reply to Changing a variable in perl module

Let's get this clear, you want to change a source file without using a file operation? What have you got against file operations?

There must be a better way of doing this. Try designing the task (whatever it is ) another way.