in reply to Re: Can't get Tk.pm to work
in thread Can't get Tk.pm to work [SOLVED]

No, I don't have mutiple versions of perl. It's just updates automatically from ubuntu's repository.
which cpan just shows:
/usr/bin/cpan

Replies are listed 'Best First'.
Re^3: Can't get Tk.pm to work
by marto (Cardinal) on Jan 26, 2018 at 16:12 UTC

    If as you say perl -v reports v5.22.1 but cpan is installing to /usr/local/lib/x86_64-linux-gnu/perl/5.20.2/ it looks as though a Ubuntu has done something weird, which wouldn't be unheard of, for example. Do you have a #!/usr/local/bin/perl if so which version? Did you try using cpanm?

    My preference, for an easy life, is to install my own version of perl elsewhere, and leave the system one alone. A custom install has resulted in fewer headaches. See also perlbrew.

      For over a year, I've started using:
      #!/usr/bin/env perl
      instead of using direct perl path.
      I've read, that env finds an executable from locations in PATH variable, which command also does, but it might resolve to not first encountered path with the named binary, but the best for context, so I've looked @ man which to see what other parameters it has, since env (I didn't find a way for it to just to show the paths, that it resolves), which has -a, that allows to show all possible paths, so I did:
      which -a perl
      It gave me only one path:
      /usr/bin/perl
Re^3: Can't get Tk.pm to work
by hippo (Archbishop) on Jan 26, 2018 at 16:27 UTC

    Forgive my skepticism. You can confirm or refute this easily enough with locate -r /bin/perl$.

    You could also say which version of ubuntu you have installed so we can determine which perl is the interloper.

      This resolves to:
      /snap/core/3604/usr/bin/perl /snap/core/3748/usr/bin/perl /snap/core/3887/usr/bin/perl /usr/bin/perl
      Then I did the following:
      for var_p in `locate -r /bin/perl$`; do echo $var_p; $var_p -v| grep ' +(v'; perl -le 'print "-" x 150;'; done
      It gave me the following results:
      This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-li +nux-gnu-thread-multi ---------------------------------------------------------------------- +-------------------- /snap/core/3748/usr/bin/perl This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-li +nux-gnu-thread-multi ---------------------------------------------------------------------- +-------------------- /snap/core/3887/usr/bin/perl This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-li +nux-gnu-thread-multi ---------------------------------------------------------------------- +-------------------- /usr/bin/perl This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-li +nux-gnu-thread-multi ---------------------------------------------------------------------- +--------------------
      According to results, all of them have version 5.22.1
      then I did: perl -le 'print for @INC;', it gave me:
      /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .
      None of the paths show 5.20.2, so, I don't get it, where cpan gets it from.

        I assume you have Ubuntu 16.04.1 LTS; x86_64, was this a new install or an upgrade from a previous Ubuntu version ? If so, what was previous version ?

        update Looks like perl v5.20.2 came with Ubuntu 15.04

        poj