first time heard. Java embeds a Perl Lib?
whould you give out some sample code for that?
The generic way to solve that problem is lex/yacc,
I'm sure there are a lot of Java lex/yacc libs on the net