in reply to code to grab the latest version of a module from CPAN?
If you don't mind CPANPLUS:
CPANPLUS::Backend->new->fetch( modules => ['Name::Of::Module'], fetchdir => '/directory/where/you/want/it', ); [download]