install CPAN::Mini, and use its cmdline tool to download a mirror:
minicpan -l ~minicpan/mirror/
to search those files, download and use this tool: https://github.com/DeeNewcum/individual_scripts/blob/master/cpan_mirror/cpan_grep.pl
Before downloading a mirror, you might want to get an estimate of how much disk space CPAN currently takes, since it's always expanding.
curl -s https://www.cpan.org/indices/cpan-stats.json | grep '"gb"'
curl -s https://www.cpan.org/indices/du-k.gz | zcat - | perl -lne'@F=split /\s+/, $_, 2; $F[1] eq "." and printf "%.1fGB\n", $F[0]/1024/1024 and last'
curl -s https://www.cpan.org/indices/find-ls.gz | zcat - | awk '{s+=$7} END {printf "%.1f GB\n", s/1000000000}'
rsync -avz -n --stats cpan-rsync.perl.org::CPAN | grep 'Total file size:'
rsync
and curl
commands reported ~32 GB, for a ratio of 6 : 1.