From the brief glimpse you've given of the problem domain, it seems as if you're looking for a recursive descent parser. Maybe take a look at Parse::RecDescent (and possibly Parse::RecDescent::FAQ although I have no experience with this module/document) or Marpa::R2.
Give a man a fish: <%-{-{-{-<
In reply to Re^3: Help to create a program
by AnomalousMonk
in thread Help to create a program
by fair
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |