I work with this kind of chalenge on my PhD thesis. But, considering this is not a complete perl related subject, I will not post about here now. If you or other wanna talk again, send private message.
On the semantic aproach, it can be done, and is not so difficult. There are some Perl modules to help too.