cpan

How can I avoid sudo-ing when installing Perl modules with 'cpan'?

假如想象 提交于 2019-11-29 18:26:32
问题 I have installed Perl from source into /usr/local, and adjusted my path accordingly, following brian d foy's suggestion here. I'm sure I'm missing something, but, now I'm trying to install stuff with the 'cpan' command and it's failing because it can't write to /usr/local. I have to use sudo, which feels wrong to me. Should CPAN stuff go to another location? Is it normal to have to use sudo? 回答1: If it really bothers you to use sudo , you can use local::lib and install modules in your home

How do I install Perl's SVN::Client?

a 夏天 提交于 2019-11-29 18:12:49
问题 I want to use the SVN::Client cpan module to check out code from a repository. But how to install and use this module? The documentation is kind of no existing. I have tried install the Alien::SVN module both through cpan and build it myself. And it seems to install okay. No error messages, and when i go into cpan again and do the following it states that the Alien::SVN module is installed. cpan> install Alien::SVN Alien::SVN is up to date. Here is my class that uses the SVN::Client: use

CPAN installing Net::Pcap and Packet module failed due to lpcap

喜夏-厌秋 提交于 2019-11-29 18:00:21
Recently, I tried to install perl module Net::Packet and Net::Pcap through cpan but it complained that it cannot find pcap library. So I was searching if cpan would accept external lib/include directory when installing module, but no luck til now. looking for -lpcap... no - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - You appear to lack the pcap(3) library. If it is installed in a non-standard locatio n, please try setting the LIBS and INC values on the command line. Or get the sources and install the pcap library from http://www.tcpdump.org/ If you install the pcap library using

What is the difference between the core, vendor and site locations in Perl?

浪子不回头ぞ 提交于 2019-11-29 14:39:45
问题 I recently ran into some trouble installing some modules and discovered to my surprise that many of the modules that had been installed, have duplicated installations and versions. Trying to track where stuff goes in a standard (if there is such a thing) installation using cpanm , I found the following results very confusing. The reports show these locations: Using cpan -V : # cpan -V /usr/bin/cpan script version 1.672, CPAN.pm version 2.22 --------------------------------------------------

How to install XML::Parser without expat-devel?

只谈情不闲聊 提交于 2019-11-29 12:16:08
问题 XML::Parser fails to build on a quite fresh 64-bit Debian box. After issuing cpan XML::Parser , cpan fails with lots of errors about Expat.c and Expat.xs: [...] Expat.xs:2182: error: ‘CallbackVector’ has no member named ‘skip_until’ Expat.c: In function ‘XS_XML__Parser__Expat_Do_External_Parse’: Expat.c:2904: error: ‘XML_Parser’ undeclared (first use in this function) Expat.c:2904: error: expected ‘;’ before ‘parser’ Expat.xs:2194: error: ‘parser’ undeclared (first use in this function) make

What is the easiest way to do XPath querying of XML data in Perl?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 11:33:11
I am looking for the simplest way possible to quickly retrieve data from an XML structure using XPath queries in Perl. The following code structure explains what I'd like to achieve: my $xml_data = "<foo><elementName>data_to_retrieve</elementName></foo>"; my $xpath_query = "//elementName"; my $result_of_query = ... what goes here? ... die unless ($result_of_query eq 'data_to_retrieve'); Obviously TIMTOWTDI applies, but what would be the easiest way to do it? XML::LibXML is not easier, but beats XML::XPath in every other aspect. use XML::LibXML; my $xml_data = XML::LibXML->load_xml( string => '

Arrow up and down does not work any more in Perl debugger and CPAN client

只愿长相守 提交于 2019-11-29 07:45:23
问题 I used to use Active Perl on my Mac OS X (v 10.7.5) and then I switched to the one provided via mac ports (v 5.12.4). Now when I run the CPAN client or the perl debugger, I cannot access the history using ArrowUp and ArrowDown, what is shown at the prompt is ^[[A and ^[[B respectively. At least on the debugger the history works, I can access past commands via ! num . 回答1: By default the only Term::ReadLine handler you get is Term::ReadLine::Perl which is quite simple and doesn't understand

Which package from CPAN should I use to send mail?

a 夏天 提交于 2019-11-29 07:02:43
Which package from CPAN should I use to send mail ? Sometime the timtowtdi approach is very tiring. For me, especially when it comes to package selection. So all I want is to send email, potentially HTML emails. Between Mail-Sendmail, Mail-Sender, NET-SMTP (by the way - not available in PPM), Mail-SendEasy, and the 80 or so other packages that have 'Mail' in their package name - which one should I choose? And while in this subject, what is your general apprach to choose the "canonical" package for a jog. I.e. the package that "everybody is using". Is there any rating or popularity billboard

How do I tell CPAN.pm to install all modules in a specific directory?

感情迁移 提交于 2019-11-29 04:19:22
I have set makepl_arg [INSTALLDIRS=site PREFIX=~/perl] mbuildpl_arg [--install_base ~/perl] in the CPAN.pm configuration. I had hoped that this would cause modules to get installed in the same place, but I still have to set multiple paths in PERL5LIB: export PERL5LIB=~/perl/share/perl/5.10.0:~/perl/lib/perl5/:~/perl/lib/perl/5.10.0 This has been the case for a long time and I have just lived with it, but I was wondering if anyone knew how to get CPAN.pm to put all modules in the same directory? Install local::lib . It will handle all the configuration for you. Have you tried using INSTALL_BASE

Uninstall all perl modules installed by cpan

随声附和 提交于 2019-11-28 23:08:15
Yesterday I wanted to test some software and in the documentation it said, to install I just needed to type cpan -i Software I never used cpan, I just know that it is the perl package manager. (Is it..?) However, it turned out that I needed loads of dependencies, and stupid as I am, I just installed all of them. (First, I had to set up cpan which asked me lots of questions) Long story short, I just want to remove all of it again. I googled a bit, and it seems like cpan does not have an uninstall routine, especially for all the packages at once. Can I just remove some directory or will I run