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

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

Beloved Brethren and Sistren:

I use cpan to install modules on a Linux system. Occasionally I will get a very long series of messages that scroll past my screen faster than I can read, but which identify an error. After much ado, the cpan program simply tells me, "make no good; won't install without force". At that point, I have no clue what went wrong, so of course I have no idea how to fix it. I can't redirect the output, because I'm in cpan.

Does anyone have any words of wisdom to help me with this vexing problem? If so, what are they?

Update:

Wow, thanks to everyone for the great ideas.

Replies are listed 'Best First'.
Re: cpan error messages
by Roger (Parson) on Sep 03, 2005 at 07:58 UTC
    I will normally go to the cpan build directory, usually ~/.cpan/build/, change to the directory for the particular module I am building, and do another build under the directory with the command: make 2>&1 | tee build.log | more.

    This way, I can build the package, redirect STDERR to STDOUT (so I can capture all build messages), capture the build messages in a build.log file, while inspecting the output page by page with more.

      I find the "look Module::Name" command extremely valuable, if used within the same session, because it doesn't reset the directory.

      So when I hit an error, and want to poke around, I hit uparrow, change "install" to "look", and there I am in the build directory already.

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.

      Thank you, Roger. I do believe you've hit it right on the head. I appreciate it...

Re: cpan error messages
by jonadab (Parson) on Sep 03, 2005 at 09:46 UTC
    I will get a very long series of messages that scroll past my screen faster than I can read

    I have a couple of ways of dealing with this. One is to set gnome-terminal to keep a larger number of lines of scrollback. Another is to run CPAN within screen. The latter works even on the console, e.g., when I'm installing a new system and haven't got the GUI up yet.

Re: cpan error messages
by dorward (Curate) on Sep 03, 2005 at 20:17 UTC

    There is a command line utility for UNIX-like systems called "script" (in the util-linux package for Gentoo, and bsdutils for Debian) that will record an interactive terminal session to a file.

    Running script cpan-session.txt before you run the CPAN shell should do the trick.