Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
more useful options
 
PerlMonks  

Re: When cpan returns the dreaded "won't install without force"

by dasgar (Deacon)
on Mar 18, 2013 at 00:23 UTC ( #1023962=note: print w/ replies, xml ) Need Help??


in reply to When cpan returns the dreaded "won't install without force"

Are you on Windows? If so, the following should work from a command prompt:

cpan install IO::Tty 1> install_test.txt 2>&1

That's basically piping STDERR to STDOUT and then STDOUT to a file (install_test.txt). However, you won't see the output on the screen at the same time.

If you have PowerShell installed and really want to display messages and send them to a file, you can use the tee-object cmdlet like the following:

cpan install IO::Tty 2>&1 | Tee-Object -FilePath C:\perl_stuff\install_test2.txt

Again, the "2>&1" is piping STDERR to STDOUT and then the tee-object is sending the output to STDOUT and a file at the same time.


Comment on Re: When cpan returns the dreaded "won't install without force"
Select or Download Code
Re^2: When cpan returns the dreaded "won't install without force"
by Lady_Aleena (Chaplain) on Mar 24, 2013 at 04:31 UTC

    Yes dasgar, I am using Windows XP SP3. I was hoping to get away from the command line and maybe write something in a script where I could dump several modules into a list and just run the script, maybe before I go to bed. I would have more control with a script over with the command line. Trust me, doing anything on the command line on a Windows machine is a pain. Here is a non-working untested beginnings of an idea.

    use strict; use warnings; use CPAN; my $CPAN = CPAN->new(); for my $module (@modules) { my $install = $CPAN->install($module); my $file = "module-name-with-hyphens.txt"; open(my $fh, '>', $file) or die $!; print $fh $install; }

    I am not sure the above will do what I want, but it is the general direction I am leaning toward.

    Have a cookie and a very nice day!
    Lady Aleena

      "Trust me, doing anything on the command line on a Windows machine is a pain."

      How so?

        marto, again apologies for the lack of specificity. Running perl scripts and checking syntax (perl -c) are okay, however perl -e gets on my nerves most of the time. Maybe I am just a big baby who likes her text editor toys like bracket match and pretty colors.

        Have a cookie and a very nice day!
        Lady Aleena

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023962]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-04-23 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (551 votes), past polls