in reply to code to replace

Seriously, I usually use 'script' if it is less than about 20-30 lines, and program otherwise...

fnord