in reply to Another question about expanding variables in text strings
s/\$(.*?\])/${$1}/g
--telesto