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

When building my Docker image I need to install Template::Toolkit using cpanm.

In my cpanfile I've defined

requires "Template::Toolkit","3.006";
which clearly is the version I can find on cpan.org.

But the build fails with

==> Found dependencies: Template::Toolkit ! Installing the dependencies failed: Module 'Template::Toolkit' is no +t installed ! Bailing out the installation for .. Found Template::Toolkit which doesn't satisfy 3.006.
It only seems to be possible to be installed when defining the minimal version to be "0".

What can I do about it? Can I do something about it?


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Replies are listed 'Best First'.
Re: cpanm --installdeps . cannot install Template::Toolkit
by Corion (Pope) on Jan 23, 2020 at 08:34 UTC

    To debug this, maybe run cpanm --verbose Template::Toolkit.

    From looking at the source, the file Template/Toolkit.pm does not contain a version number at all, so this might throw up cpanm. Maybe have requires "Template" "3.006"; instead, or requires "Template-Toolkit-3.006.tar.gz" (or however cpanfile lets you specify a distribution instead of a module).

      From looking at the source, the file Template/Toolkit.pm does not contain a version number at all, so this might throw up cpanm.

      That would explain it.


      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

      Brother atoomic added the version number in V 3.007.


      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
Re: cpanm --installdeps . cannot install Template::Toolkit
by Anonymous Monk on Jan 23, 2020 at 08:34 UTC

    In my cpanfile I've defined requires "Template::Toolkit","3.006"; which clearly is the version I can find on cpan.org.

    Hi,

    The article isn't a module :)

    $ mversion -f Template::Toolkit Template Warning: module 'Template::Toolkit' does not seem to be installed. Template 2.25
Re: cpanm --installdeps . cannot install Template::Toolkit
by Anonymous Monk on Jan 23, 2020 at 09:08 UTC

    What can I do about it? Can I do something about it?

    Don't guess , let perl remind you what you typed ;) scandeps.pl -B -V -c -C ~/cache-scandeps.dat ....yourprogram.pl

Re: cpanm --installdeps . cannot install Template::Toolkit
by Anonymous Monk on Jan 23, 2020 at 15:02 UTC

    The Perl toolchain can take a little getting used to, because dependencies are in terms of modules, not distributions, even though it's the distributions that get installed to get the modules. This is actually the right way to do it, because this way you can still find the modules you need, even if the distributions get refactored.

    It is usual to name a distribution after the chief module in it, but this is not always done. Your case is particularly confusing because the chief module is Template, but the distribution is Template-Toolkit. Not only that, but there actually is a Template::Toolkit module in the distribution, but it contains no functionality, and no version number.

    In this case it seems to me the best thing to do is to depend on the modules whose functionality you are actually using. I'm pretty sure if you just say

    requires "Template","3.006";

    things will come out the way you want.

      Thanks! You are right!


      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e