What do you mean do it by hand? He's got perl :-) It
shouldn't be too challenging to put together some perl
that will go through and replace $counter with $a1 and
then track the relationships. So when you want to send
out your code you just run it through your translator.