you can do this in two steps:
read open dump all to a variable (in memory) apply a substitution to this variable close re-open the file, now for writing print the changed variable to the file (overwrite the whole file) and close again
No temp files here, and your file is updated as you want. Use perldoc for the details.
In reply to Re^3: opening file for editing
by pvaldes
in thread opening file for editing
by ramprasad27
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |