in reply to SOS: Ability to GET got BOMed (resolved)

Based on the timing, I figured installing File::BOM somehow damaged the files of WWW::Mechanize

If the files got "damaged" then I think you'd be seeing some more serious error messages from scripts using WWW::Mechanize. If WWW::Mechanize optionally used File::BOM if it is installed, then that might possibly make sense. However, if I am understanding correctly, then you couldn't even get File::BOM installed in the first place? Even if you did, File::BOM isn't mentioned anywhere in the WWW::Mechanize source or the dependency tree. So overall I have to doubt whether simply installing (or trying to install) File::BOM would cause WWW::Mechanize to stop downloading files...

So I would suggest you debug the two problems separately: Why can't you get new modules installed, and why did your WWW::Mechanize stop working.

It looks like your cpan is malfunctioning, at various places you're getting error messages like "Couldn't move C:\strawberry\cpan\build\tmp-3808\ExtUtils-MakeMaker-7.30\lib to C:\strawberry\cpan\build\ExtUtils-MakeMaker-7.30-pzCWn3\lib: No such file or directory at C:\strawberry\perl\lib/CPAN/Distribution.pm line 516". This is quite strange. I'm not an expert at debugging the cpan client on Windows, so instead of suggesting things to try, which might muck stuff up even more, perhaps for now as a first step you can just switch CPAN clients - give App::cpanminus a try, cpanm should already come with Strawberry Perl.

As for WWW::Mechanize, it looks like you're checking for errors - are you getting any? Try removing the eval, since at this stage you're interested in seeing any error messages that may show up. Have you tried setting up a small script (Short, Self-Contained, Correct Example) that just downloads one file, to see if it still works in general? If not, post the code that doesn't work here.

Replies are listed 'Best First'.
Re^2: SOS: Ability to GET got BOMed
by palkia (Monk) on Aug 30, 2017 at 23:44 UTC
    Thank you haukex.

    you couldn't even get File::BOM installed in the first place?

    Correct.

    File::BOM isn't mentioned anywhere in the WWW::Mechanize source or the dependency tree. So overall I have to doubt whether simply installing (or trying to install) File::BOM would cause WWW::Mechanize to stop downloading files...

    Couldn't them both depend on the same module, that was damaged by File::BOM and so affecting the functionality of WWW::Mechanize ?

    So I would suggest you debug the two problems separately: Why can't you get new modules installed, and why did your WWW::Mechanize stop working.

    I suppose it is possible I have lost the ability to install new modules from cpan some time ago without noticing, as I don't do so often, but I'm sure about this completely new problem with WWW::Mechanize having something to do with the attempt to download/install File::BOM, the timing is just too perfect, and I have done nothing else that might have such an affect on WWW::Mechanize.

    you can just switch CPAN clients - give App::cpanminus a try, cpanm should already come with Strawberry Perl.

    I have no idea what CPAN clients are, but I'll read about it.
    I'm assuming it doesn't require a functioning CPAN to be downloaded/installed.

    Have you tried setting up a small script (Short, Self-Contained, Correct Example) that just downloads one file, to see if it still works in general?

    Please see the above UPDATE that includes such an experiment.
    All files/page url-ed there does in fact exist.

    Thank you.
      Couldn't them both depend on the same module, that was damaged by File::BOM and so affecting the functionality of WWW::Mechanize ?

      That is possible (that's why I was investigating it), but based on my findings and experience I just thought it to be really unlikely, or rather, that other explanations (the two problems are unrelated) are much more likely. If an installation somehow got broken by a failed install of File::BOM, I would expect failures in other modules to be more loud than a silently failing file download. Plus, your logs seemed to be showing that the installation failed even before any files from the modules got to the target directories, meaning the chance that the Perl installation was affected by the install failures is small.

      I'm sure about this completely new problem with WWW::Mechanize having something to do with the attempt to download/install File::BOM

      I'm not sure what makes you so sure, you did write this post after updating the root node with the solution, or not? There is also a way to test this theory separately as well: You can try installing the modules without using cpan, and instead by downloading the tarball yourself and using the usual perl Makefile.PL; make; make test; make install commands (Update: see A Guide to Installing Modules). If that works, then the failure is coming from the cpan tool.

      I have no idea what CPAN clients are, but I'll read about it.

      cpan, what you've been using, is a CPAN client, I was suggesting that instead of cpan, you try cpanm, a different CPAN client that has basically the same functionality (it downloads and installs modules and their dependences).

        I'm not sure what makes you so sure,

        As for the causation, I was sure due to the perfect time correlation between the 2 events (as mentioned in the "solution").

        you did write this post after updating the root node with the solution, or not?

        I wrote this post right after the "update" but some time before the "solution".

        downloading the tarball yourself and using the usual perl Makefile.PL; make; make test; make install commands.

        I've bolded all the things in you quote that I'm now encountering for the very first time.
        I'll add those to my list of things to lookup when I can.
        (so annoying being a nub ^^)

        Thx again.