Welcome to JavaRanch.
There is ofcourse not one "correct" or "best" language. You can do parsing in both those languages.
Scala has stuff for parsing in its standard library. I haven't used it though, so I can't tell you much on how it works or if it's easy to use. I don't know much about Perl but as far as I know it's a good language for
string processing.