in reply to File I/O
This feels like a job for pi!
bash$ perl -pi .oops -e 's/(\d+)/$1+1/e' filename.ext
Just what are p, i, and e? Check the perlrun page for further information.
Garh!! davidrw seems to have beaten me by several seconds on this. In answer to his question:
I would say the longer self contained version is probably more maintainable — depending on where the application is used/stored. The pi-way is fine for a one time addition to one's own crontab, but for full platform compatability and for the sake of future readers (who may not know perl all that well), the longer version may be better. It depends.
-Paul
|
|---|