If you're not up to the Parse::RecDescent challenge, you can download the code used in chapter 6 ("Global Matching") of my book. Specifically, from 6.6, "Parsing a language". The code is in examples 6.6 and 6.7. It implements a simple calculator with variable support.
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perlhacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;