in reply to Re^6: cURL And XML breaking the install of a previosuly fine script
in thread cURL And XML breaking the install of a previosuly fine script

Let's take a look at the failed install attempt, before the force, remember the devil is in the detail:

home/ross/perl5/perlbrew/perls/perl-5.18.4/bin/perl

In your first post you mention that 5.18 is the system perl. However the failing script reports:

/usr/local/lib/x86_64-linux-gnu/perl/5.24.1

Another version. So this suggests to me that you used cpanm from your system perl, to install the module, and the code your running is using 5.24, which does not have this module installed. Are you running multiple perls? You mentioned perlbrew.

Replies are listed 'Best First'.
Re^8: cURL And XML breaking the install of a previosuly fine script
by wintermute115 (Acolyte) on Apr 20, 2017 at 20:46 UTC
    I don't think I am. I did install 5.18 via perlbrew (5.24 is the system perl), but then I uninstalled it. But I might have installed cpanm while I was using perlbrew. OK, I managed to install it via cpan, and it looks like it worked? Now I'm getting this error, which is coming from XML::RSS or one of its dependencies:
    $ ./scripts/podcasts/podcasts.pl -l Use of uninitialized value in subroutine entry at /usr/local/share/per +l/5.24.1/Role/Tiny.pm line 461. Can't call method "_attrs" on an undefined value at /usr/local/share/p +erl/5.24.1/Specio/OO.pm line 168. Compilation failed in require at /usr/local/share/perl/5.24.1/Specio/D +eclare.pm line 11. BEGIN failed--compilation aborted at /usr/local/share/perl/5.24.1/Spec +io/Declare.pm line 11. Compilation failed in require at /usr/local/lib/x86_64-linux-gnu/perl/ +5.24.1/DateTime/Types.pm line 12. BEGIN failed--compilation aborted at /usr/local/lib/x86_64-linux-gnu/p +erl/5.24.1/DateTime/Types.pm line 12. Compilation failed in require at /usr/local/lib/x86_64-linux-gnu/perl/ +5.24.1/DateTime/Duration.pm line 12. BEGIN failed--compilation aborted at /usr/local/lib/x86_64-linux-gnu/p +erl/5.24.1/DateTime/Duration.pm line 12. Compilation failed in require at /usr/local/lib/x86_64-linux-gnu/perl/ +5.24.1/DateTime.pm line 14. BEGIN failed--compilation aborted at /usr/local/lib/x86_64-linux-gnu/p +erl/5.24.1/DateTime.pm line 14. Compilation failed in require at /usr/local/share/perl/5.24.1/DateTime +/Format/Mail.pm line 7. BEGIN failed--compilation aborted at /usr/local/share/perl/5.24.1/Date +Time/Format/Mail.pm line 7. Compilation failed in require at /usr/local/share/perl/5.24.1/XML/RSS/ +Private/Output/Base.pm line 9. BEGIN failed--compilation aborted at /usr/local/share/perl/5.24.1/XML/ +RSS/Private/Output/Base.pm line 9. Compilation failed in require at /usr/local/share/perl/5.24.1/XML/RSS. +pm line 9. BEGIN failed--compilation aborted at /usr/local/share/perl/5.24.1/XML/ +RSS.pm line 9. Compilation failed in require at ./scripts/podcasts/podcasts.pl line 1 +8. BEGIN failed--compilation aborted at ./scripts/podcasts/podcasts.pl li +ne 18.
    Any ideas?

      You can start diagnosing which module exactly is broken by testing each module in that chain in turn:

      perl -v perl -MXML::RSS -e1 perl -v perl -MDateTime::Format::Mail -e1 ... perl -v perl -MSpecio::Declare -e1 perl -v perl -MRole::Tiny -e1

      Then, reinstall the module that is broken at the bottom of the dependency chain.

      If you are doing this in the system Perl, I would reinstall the system Perl from the package manager and only install modules into it using your vendors package manager and the packages provided by your OS vendor. The system Perl belongs to your OS vendor.

        I went through those, and didn't see anything interesting. Perl-v reported 5.24.1 each time; perl-M had no output each time.

        So I set up a script that used used each of those modules in turn, printing its name beforehand, so I could see where it was having a problem. And it ran fine.

        So I created a script that just had the use statements from the broken script, and it failed. So I removed a line at a time to see which one was causing XML::RSS to break.

        It was Try. Moving that to be used after XML::RSS seems to have made it work. Thanks for the help :)

        I have no idea why that might have broken it, and I'll spend some more time digging into it, but for now... it seems to be working.

      "I don't think I am"

      All the evidence points to this. cpanm is just a perl module, installed to a specific perl, in this case v5.18 which you installed via perlbrew. I'll take a look at the next issue when I get to work.

      Update: I may not get round to looking at this in any detail today but you require credentials.pl, which does not return true. From the linked docs:

      "The file must return true as the last statement to indicate successful execution of any initialization code, so it's customary to end such a file with 1; unless you're sure it'll return true otherwise. But it's better just to put the 1; , in case you add more statements."

      (This is a continuation of this thread) I have a script I've been using to pull down podcasts for several years, and I've just gotten a new computer and I'm having difficulty getting it to work again. I went from Ubuntu 14.04 with perl 5.18 to Ubuntu 17.04 with perl 5.24. I think the only problem I have remaining is that XML::RSS doesn't seem to want to run. cpan says it's installed and up to date, but when the script runs, it outputs:
      $ ./scripts/podcasts/podcasts.pl Use of uninitialized value in subroutine entry at /usr/local/share/per +l/5.24.1/Role/Tiny.pm line 461. Can't call method "_attrs" on an undefined value at /usr/local/share/p +erl/5.24.1/Specio/OO.pm line 168. Compilation failed in require at /usr/local/share/perl/5.24.1/Specio/D +eclare.pm line 11. BEGIN failed--compilation aborted at /usr/local/share/perl/5.24.1/Spec +io/Declare.pm line 11. Compilation failed in require at /usr/local/lib/x86_64-linux-gnu/perl/ +5.24.1/DateTime/Types.pm line 12. BEGIN failed--compilation aborted at /usr/local/lib/x86_64-linux-gnu/p +erl/5.24.1/DateTime/Types.pm line 12. Compilation failed in require at /usr/local/lib/x86_64-linux-gnu/perl/ +5.24.1/DateTime/Duration.pm line 12. BEGIN failed--compilation aborted at /usr/local/lib/x86_64-linux-gnu/p +erl/5.24.1/DateTime/Duration.pm line 12. Compilation failed in require at /usr/local/lib/x86_64-linux-gnu/perl/ +5.24.1/DateTime.pm line 14. BEGIN failed--compilation aborted at /usr/local/lib/x86_64-linux-gnu/p +erl/5.24.1/DateTime.pm line 14. Compilation failed in require at /usr/local/share/perl/5.24.1/DateTime +/Format/Mail.pm line 7. BEGIN failed--compilation aborted at /usr/local/share/perl/5.24.1/Date +Time/Format/Mail.pm line 7. Compilation failed in require at /usr/local/share/perl/5.24.1/XML/RSS/ +Private/Output/Base.pm line 9. BEGIN failed--compilation aborted at /usr/local/share/perl/5.24.1/XML/ +RSS/Private/Output/Base.pm line 9. Compilation failed in require at /usr/local/share/perl/5.24.1/XML/RSS. +pm line 9. BEGIN failed--compilation aborted at /usr/local/share/perl/5.24.1/XML/ +RSS.pm line 9. Compilation failed in require at ./scripts/podcasts/podcasts.pl line 1 +8. BEGIN failed--compilation aborted at ./scripts/podcasts/podcasts.pl li +ne 18.

      Line 18, referenced there at the end is:

      use XML::RSS;

      I've searched online and not found anything that looks like this, and I don't know where to go from here. Does anyone have any ideas?

      I've tried using XML::FEED::PARSER::LITE, but it doesn't seem to do what I need, but in principle I have no objections to using another module if you can recommend one

        You said you upgraded, and are not using perlbrew anymore. How about renaming ~/perl5 to ~/perl5.OLD (this is the directory where cpan puts everything), then try to install cpan modules again? This re-installs many modules but all to their newest versions. I had problems in the past because the libraries were not latest-greatest (alternative is upgrading all your modules, there are some oneliners out there to do that or packages like cpan-outdated which lists them).