It depends what you want to achieve. Could you be more specific?

There are various modules on CPAN to parse SQL text like

If it's just about creating your own SQL DSL , I'd suggest designing a combination of Perl functions like sub SELECT and overloaded operators to return an AST of your queries.

I did this before...

update

and of course there is also

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

) RFC: A DSL for SQL (part 1)


In reply to Re: Examples or tutorials for Perl grammars? by LanX
in thread Examples or tutorials for Perl grammars? by LittleJack

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":