in reply to There is more than one way (and mine is not the best)
Just a bit of a nit-pick, but when the regex is anchored to the start of the string (using "^"), the "g" modifier at the end is kinda pointless. The fact that you're using "g" everywhere makes me wonder if you understand its purpose. (browse through the "perlre" man page)s/^col.//gi;
The whole two-pass design is a bit mysterious -- I'd be surprised if this cannot be done in a single pass (read .txt, write .axe, without the intermediary .tmp file). It might be instructive to provide a snippet of the "txt" input, and the equivalent snippet of intended output. (And if that output was really created by a perl script, post that script.)
|
|---|