One thing worth considering is that Perl6 might be a more suitable language for such a project than Perl5. The memory usage of some of the Perl6 implementations is supposed to be greatly improved, and you'll be able to specify native variable types where necessary.