And somewhat sidestepping the original problem, you might try and use something like SQL::Statement to parse your data (specifically probably the perldoc for "SQL::Statement::Structure" is of interest; see link in the aforementioned module's docs) and then manipulate that form and re-output the modified SQL after you've twiddled it accordingly.
Update: Grrr, link to ...::Structure wasn't working. Reworded.
In reply to Re: Substitutions Within Substitutions
by Fletch
in thread Substitutions Within Substitutions
by Sprad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |