![]() |
|
Don't ask to ask, just ask | |
PerlMonks |
Re^2: substitute 4 spaces instead of a tabby anneli (Pilgrim) |
on Nov 07, 2011 at 10:40 UTC ( #936471=note: print w/replies, xml ) | Need Help?? |
With regards to not truncating anything accidentally, davido mentioned this excellent suggestion: move the original file out of the way first (e.g. if it's called shock_api.h, call it shock_api.h.bak or similar; there's a built-in called rename to do this), then read in from shock_api.h.bak and write out to shock_api.h. This solves the simultaneous read/write truncation issue, and creates a backup for you in case things go awry.
In Section
Seekers of Perl Wisdom
|
|