If you're going to write to the file, you might want to add one or more > characters in the open statement, as appropriate. Opening the file for reading and then trying to write to it won't work very well, either. (Follow the link to open or type perldoc -f open at the command prompt).
I think you might want to close MYFILE in the loop, too. :) local is good, as well, as you don't have to reset $/ manually.
Comment on RE: Re: problem with print content of file