"be consistent" | |
PerlMonks |
In place editing of text filesby jevaly (Sexton) |
on May 28, 2009 at 07:50 UTC ( [id://766596]=perlquestion: print w/replies, xml ) | Need Help?? |
jevaly has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks, I have a textfile looking like this:
I want to change it in this:
To achieve this epic feat, I wrote the following piece of code (roughly based on my camel):
This renders the following output:
I cannot explain this. I know there are modules helping for in place editing, but I don't want to use them. can someone explain the output, why it looks like this and what I can do to achieve my goal?
Back to
Seekers of Perl Wisdom
|
|