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

not sure where to post this question!

want to follow this guide http://tools.cac.washington.edu/2010/04/avaya-pbx-admin-web-service.html

know nothing about perl but in guide, it has asked first install perl and then to install Expect,Data::Dumper, Term::VT102 modules on command line.

aprt from Data::Dumper module others were installed. when I try to install Data::Dumper module getting followin error.

root@ptx-Latitude-:~# perl -MCPAN -e 'install Data::Dumper' Can't locate object method "install" via package "Data::Dumper" at -e +line 1. root@ptx-Latitude-:~#
am using uguntu and perl installed with apt-get command.

any support would be much apprecaited.

Replies are listed 'Best First'.
Re: Roger the Phone Guy
by Corion (Patriarch) on Aug 01, 2018 at 17:23 UTC

    If you installed Perl using apt-get, you should also install all other modules using apt-get:

    apt-get install libexpect-perl libterm-vt102-perl libdata-dumper

    Most likely, Data::Dumper is already installed, unless your OS vendor crippled your Perl installation. Then maybe you can get the core modules that should be distributed with Perl in a package named perl-core or something like that.

Re: Roger the Phone Guy
by jahero (Pilgrim) on Aug 01, 2018 at 17:29 UTC
Re: Roger the Phone Guy
by Tux (Canon) on Aug 02, 2018 at 11:30 UTC

    You've got answers enough already that should guide you to success. I'd like to expand on this error message.

    If you have installed perl and cpan, it is most often way more comfortable to type $ cpan Data::Dumper directly. No need for the install keyword. If you still prefer the module approach, quote the module name like perl -MCPAN -we'install "Data::Dumper"'

    What you did shows something funny, which I cannot explain

    $ perl -MCPAN -we'install Data::Dumper' Can't locate object method "install" via package "Data::Dumper" at -e +line 1. $ perl -MCPAN -we'install "Data::Dumper"' : Data::Dumper is up to date (2.161). $ perl -MCPAN -wE'install Sys::Hostname' Can't locate object method "install" via package "Sys::Hostname" at -e + line 1. $ perl -MCPAN -wE'install "Sys::Hostname"' : The most recent version "1.22" of the module "Sys::Hostname" is part of the perl-5.28.0 distribution. To install that, you need to +run force install Sys::Hostname --or-- install X/XS/XSAWYERX/perl-5.28.0.tar.gz $ perl -MCPAN -wE'install Kitchen::Sink' : Warning: Cannot install Kitchen::Sink, don't know what it is. Try the command i /Kitchen::Sink/ to find objects with matching identifiers. $ perl -MCPAN -wE'install "Kitchen::Sink"' : Warning: Cannot install Kitchen::Sink, don't know what it is. Try the command i /Kitchen::Sink/ to find objects with matching identifiers.

    perl -d:TraceUse ... does not show hints of Data::Dumper being loaded (Sys::Hostname is loaded), so I have no idea why some module pattern generate an error where others do not.


    Enjoy, Have FUN! H.Merijn
Re: Roger the Phone Guy
by LanX (Saint) on Aug 01, 2018 at 17:42 UTC
    > uguntu

    I failed googling for this OS ... could you provide a link?

    update

    you most likely mean Ubuntu, but there are so many flavors out there ...

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      apt-get install libexpect-perl libterm-vt102-perl libdata-dumper
      above are installed.

      Is there any way to check if module is loaded and installed on perl ?

        I usually do perldoc -l Data::Dumper at the command line. Just tried it on one of my systems, and I got

        /usr/lib/x86_64-linux-gnu/perl/5.26/Data/Dumper.pm
        in response. To find out the version, I grep for version in that file ..
        $ grep -i '^version' /usr/lib/x86_64-linux-gnu/perl/5.26/Data/Dumper.p +m Version 2.167 (January 4 2017) $
        Conversely, if the perldoc approach doesn't turn anything up, either the module isn't installed -- or it doesn't have POD. Then you could try using it in the debugger:
        $ perl -MData::Dumper -de 1 Loading DB routines from perl5db.pl version 1.51 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): 1 DB<1>
        If that loads OK, then the module does exist. If Perl can't find the module, it'll complain.

        Alex / talexb / Toronto

        Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

        > Is there any way to check if module is loaded and installed on perl ?

        There are many ways:

        perl -MModule::Metadata -le'$i=Module::Metadata->new_from_module($ARGV +[0]);print $i->{filename}' Data::Dumper
        perl -MExtUtils::Installed -le'$i=ExtUtils::Installed->new;print grep +/$ARGV[0]/, $i->files("Perl")' Dumper
        perl -MFile::Find -le'find(sub{print $File::Find::name if /$ARGV[0]/}, +$_) for @INC' Dumper

        I use whichpm. It's a module on its own and needs to be installed.