in reply to A command-line utility to list CPAN modules/dists?

The MetaCPAN API should make something like that pretty easy.

Here's a list of modules from the distribution name...

perl -MLWP::Simple -MJSON -MURI::Escape -E'my $data = from_json get sprintf ",path,module&size=4999", uri_escape shift; say for map { sprintf "%s %s", $_->{name}, $_->{version} } map { @{$_->{fields}{module}} } @{$data->{hits}{hits}}' Moose

... I leave the reverse as an exercise for the reader.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'