ikegami has asked for the wisdom of the Perl Monks concerning the following question:

Is there an easy way to get the list of tarballs (e.g. T/TI/TIMB/DBI-1.616.tar.gz, or even DBI-1.616.tar.gz) installed in a session of cpan or similar tool? (Doesn't matter if failed attempts are included or not.)

I could parse the output easily enough, but if there's a ready-made solution, might as well use that!

Replies are listed 'Best First'.
Re: What modules got installed?
by Khen1950fx (Canon) on Mar 15, 2011 at 23:59 UTC

      I had never heard of script, thanks. I don't really need to monitor input, so tee would be just as good.

      The whole shell redirect inside of cpan is novel too. install Foo | tee out allows you to see what's going on.

Re: What modules got installed? (keep_source_where)
by ikegami (Patriarch) on Mar 16, 2011 at 03:09 UTC

    The directory indicated by cpan config item keep_source_where (~/.cpan/sources) contains every distribution I've ever attempted to install, going back years. That catch is that it's not specific to a Perl install.

    But if one were to set keep_source_where differently when installing for a specifc install of Perl, one could not just track the name of the distros but have the actual distros (by author) that was installed for that install of Perl. Perfect :)

    perl -MCPAN -MCPAN::HandleConfig -e' CPAN::HandleConfig::require_myconfig_or_config(); $CPAN::Config->{keep_source_where} = "/tmp/sources/"; shell; ' CGI

    created

    /tmp/sources/ /tmp/sources/authors/ /tmp/sources/authors/id/ /tmp/sources/authors/id/F/ /tmp/sources/authors/id/F/FL/ /tmp/sources/authors/id/F/FL/FLORA/ /tmp/sources/authors/id/F/FL/FLORA/CHECKSUMS /tmp/sources/authors/id/F/FL/FLORA/FCGI-0.71.tar.gz /tmp/sources/authors/id/M/ /tmp/sources/authors/id/M/MA/ /tmp/sources/authors/id/M/MA/MARKSTOS/ /tmp/sources/authors/id/M/MA/MARKSTOS/CGI.pm-3.52.tar.gz /tmp/sources/authors/id/M/MA/MARKSTOS/CHECKSUMS

    Note that FCGI is a prereq of CGI.

Re: What modules got installed?
by Anonymous Monk on Mar 15, 2011 at 22:57 UTC
    cpanp keeps a install-logs directory ( s conf write_install_logs 1), I believe cpan offers a similar feature ( histfile / histsize )
      cpan's histfile is used to store the command history. I'll give your cpanp idea a whirl, thanks.