in reply to Re: Getting CPAN.pm to accept Makefile.PL prompts
in thread Getting CPAN.pm to accept Makefile.PL prompts

$ cpan Expect YAML

I neglected to mention that I'm on MS Windows (apologies for that) ... and the success of that command relies on the Expect module ... which won't install on MS Windows.

I gave it a go, anyway. My CPAN/Config.pm decrees that:
'cpan_home' => q[C:/.cpan],
so I created the following 'PDL.yml' in the C:/.cpan/prefs directory:
--- match: distribution: "CHM/PDL-" pl: eexpect: mode: anyorder timeout: 15 reuse: 1 talk: - "Do you still wish to continue" - "y\n"
(I didn't exactly pay attention to the whitespace you specified, but I doubt that's having any bearing.)

Sure enough, running cpan Expect YAML fails to install Expect, and cpan get CHM/PDL-2.4.7_004.tar.gz still hangs at the "annoying" prompt.

Please correct me if I'm wrong, but I gather this approach won't work on MS Windows.

Cheers,
Rob

Replies are listed 'Best First'.
Re^3: Getting CPAN.pm to accept Makefile.PL prompts
by Tux (Canon) on Nov 10, 2010 at 10:14 UTC

    If Expect doesn't install, this indeed won't work at all.

    The falies are in YAML format, which implies that whitespce is extremely important, and the file you show will most likely cause an error message from cpan, saying it is badly formatted and will be ignored.

    I never tried to use distroprefs on Windows. In fact I try to avoid Windows as much as possible.

    Do you use Strawberry or ActivePerl?


    Enjoy, Have FUN! H.Merijn
      If Expect doesn't install, this indeed won't work at all

      The killer is that neither IO::Pty nor IO::Tty will work on MS Windows.

      Do you use Strawberry or ActivePerl?

      I generally use perls that I've built myself - using the 32-bit compiler from mingw.org or the 64-bit compiler from mingw64.sf.net. I do, however, have both StrawberryPerl and ActivePerl installed.

      I don't bother too much any more with the Microsoft Compilers, preferring to use the mingw compilers instead - even with ActivePerl.

      You may already be aware of this, but with ActivePerl and MinGW you can build anything that can be built on StrawberryPerl ... and more. (For mine, StrawberryPerl currently "is in front" simply on the basis of the non-core extensions that ship with it.)

      Cheers,
      Rob

      The files don't have to be in YAML format, as it will also work with files containing plain ol' perl data structures. If both are available, it prefers the YAML version if a YAML-ish module is available with which to parse it. eg, on my CPAN-testing smokers I have ...

      $ cat IPC-Run.yml --- comment: "Ignore (ADAMK|TODDR)/IPC-Run-0* on netbsd/alpha, cos it brea +ks" match: distribution: "(ADAMK|TODDR)/IPC-Run-0" perlconfig: archname: "alpha-netbsd" disabled: 1 $ cat IPC-Run.yml.dd $VAR1 = { 'disabled' => '1', 'comment' => 'Ignore (ADAMK|TODDR)/IPC-Run-0* on netbsd/alpha, cos i +t breaks', 'match' ...

      The .dd file is auto-generated from the .yml file by this script:

      #!/bin/sh for i in *yml; do if [[ ! -s $i.dd || $i -nt $i.dd ]]; then echo Rebuilding $i perl -MYAML=LoadFile -MData::Dumper -e "print Dumper(LoadFile('$ +i'))">$i.dd fi done

      The file extensions .yml and .dd are significant.