On Fri, 2 Mar 2001, Max Ischenko wrote: > I have the following Ruby code: > > def Mutt.afterConfigure > system("perl -i -p -e 's/^#define DEBUG/#undef DEBUG/' config.h") [...] > > Now, I want to write a generic function that will make changes to a file, How would one make it really generic? Ruby has -i as well, so how can one get at it to do: ruby -i.bak -p -e 'gsub(/^#define DEBUG/, "#undef DEBUG/") config.h in an elegant way, within a program? Is it worth raising an RCR for open and IO to have some means to provide this backup facility? > > > What do I do wrong? One thing was not to attribute this statement to (I think) Gregory Benford: > Any technology distinguishable from magic is insufficiently advanced. :-) Clarke's was: Any sufficiently advanced technology is indistinguishable from magic. Was he lurking on the Ruby list at the time? :-) I've not noticed him post... Sorry, this is drifting wildly off topic. Hugh