http://qs1969.pair.com?node_id=982962


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 "http://api.metacpan.org/v0/module/_search?q=distribution:%s+AND+module.indexed:true+AND+status:latest&fields=release,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'