http://qs321.pair.com?node_id=1229183


in reply to Installing CPAN modules

For that matter, why not the following (using just the CPAN modules)?

# Almost no testing, so be warned... perl -Mstrict -Mwarnings -MCPAN -le ' CPAN::HandleConfig->load; CPAN::Shell::setup_output; CPAN::Index->reload; CPAN::HandleConfig::edit( q{prerequisites_policy follow}, ); my @tk_modules = grep { $_->id =~ m/^\bTk\b(?:::.*)?$/i; } CPAN::Shell->expand( q{Module}, q{/./}, ); foreach my $mod ( @tk_modules ) { print qq{Attempting install of }, $mod->id; CPAN::Shell->install($mod); } '

Hope that helps.

Update: 2019-01-30 - Changed regex from /^\bTk\b/i to /^\bTk\b(?:::.*)?$/i to get only Tk and Tk::* modules.