This is not about increasing the amount of memory, but about a possible solution for you.
You can use cpanm instead of cpan, therefore:
This will install cpanm for you
$ curl -L http://cpanmin.us | perl - --self-upgrade
and after installing the modules, for example:
$ cpanm Task :: Plack
cpanm requires much less memory.
jm666 source share