cpan

Perl modules not loading correctly when running as non-root user

ε祈祈猫儿з 提交于 2019-12-11 00:26:36
问题 I'm running into an issue with Perl on a linux system. When installing new modules (as root), I would occasionally have issues where running scripts as a regular user, I would not be able to access the new module without manually going in and chmod 775'ing the module related files and directories. I recently performed a CPAN upgrade, as well as installing several modules for a new project. Now, Perl has become almost unusable as a regular user, because of errors that don't appear to be

How do I fix Perl's Font::FreeType compilation errors?

╄→尐↘猪︶ㄣ 提交于 2019-12-10 23:49:10
问题 I am trying to install the Perl module Font::FreeType on a CentOS linux box using cpan. I run sudo cpan and inside the cpan shell I run install Font::FreeType . However make fails as follows: Writing Makefile for Font::FreeType cp lib/Font/FreeType.pm blib/lib/Font/FreeType.pm cp lib/Font/FreeType/Face.pm blib/lib/Font/FreeType/Face.pm cp lib/Font/FreeType/Glyph.pm blib/lib/Font/FreeType/Glyph.pm /usr/bin/perl /usr/lib/perl5/site_perl/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.8

Perl: Testing an input reader?

末鹿安然 提交于 2019-12-10 20:44:35
问题 Is there a way to automatically test using the standard Test etc. modules whether a Perl program is reading input from e.g. STDIN properly? E.g. testing a program that reads two integers from STDIN and prints their sum. 回答1: It's not 100% clear what you mean, I'll asnswer assuming you want to write a test script that tests your main program, which as part of the test needs to have test input data passed via STDIN. You can easily do that if your program outputs what it reads. You don't need a

Automatically Install Package-Based Perl Modules in Ubuntu

落花浮王杯 提交于 2019-12-10 15:17:10
问题 I would like to install the Perl modules required by a specific Perl script, such as those listed by the perl-depends tool. However, I would like to do that in Ubuntu using the apt-get , meaning installing the modules through the package repository and not through CPAN. Most similar questions (such as this one) address ways of doing that through CPAN. 回答1: Debian-Apt-PM 回答2: This will list all packages having perl in them: sudo apt-cache search perl * then: sudo apt-get install pkg_name_in

Is there a CPAN module for converting seconds to English?

会有一股神秘感。 提交于 2019-12-10 15:04:30
问题 Is there a CPAN module that can convert a number of seconds to a human-readable English description of the interval? secToEng( 125 ); # => 2 min 5 sec secToEng( 129_600 ); # => 1 day 12 h The format isn't important as long as it's human-readable. I know that it would be trivial to implement. 回答1: Since Perl v5.9.5, the modules Time::Seconds and Time::Piece are part of the core Perl distribution. So you can use them without installing additional modules. perl -MTime::Seconds -e 'my $s=125; my

Perl module for text comparison

泪湿孤枕 提交于 2019-12-10 14:38:51
问题 Can anyone suggest a Perl module which can compare two strings and return a degree to which they match? I searched CPAN extensively, and although there are similar modules like String::Approx and Data::Compare , they are not what I am looking for. Suppose I have two strings : I love you , and I boht you . I want functionality which will compare these two strings, taking into account numerous parameters, the matching of words in correct order ( love as the first word in a string should not

What means “not running under some shell” in Perl scripts?

孤人 提交于 2019-12-10 13:47:00
问题 In many perl scripts (especially in famous CPAN distros) I find the following piece of code: eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}' if 0; # not running under some shell I was wondering what it is for? Thanks. 回答1: Some systems don't recognize the #!/usr/bin/perl line at the start of scripts, and so trying to invoke a Perl program by name on such a system will simply pass the script to the shell. In order to combat this, portable Perl programs begin with a line that, when interpreted by

How can I make Strawberry Perl's cpan(1) find perl?

一世执手 提交于 2019-12-10 13:39:28
问题 I'm having trouble installing Template module with Strawberry Perl. cpan Template yields the following: Writing Makefile for AppConfig C:strawberryperlbinperl.exe: not found dmake.EXE: Error code 255, while making 'blib\lib\.exists'` I haven't been able to understand either how to affect the path so dmake will work correctly why the path (which is correct) does not have any \ in it. 回答1: If you've been using MKS, you not only need to be sure you've removed it from your PATH, but you also need

CPAN Perl modules installer not finding tar file

巧了我就是萌 提交于 2019-12-10 12:49:17
问题 It seems I have a configuration problem when installing Perl modules through CPAN and I don't know how to correct it: [root@ip JESSE]# pwd /root/.cpan/sources/authors/id/J/JE/JESSE [root@ip JESSE]# ls -l total 240 -rw-r--r-- 1 root root 105464 Feb 20 11:39 CHECKSUMS -rw-r--r-- 1 root root 9223 Apr 12 2011 Locale-Maketext-Simple-0.21.tar.gz -rw-r--r-- 1 root root 125483 Feb 20 11:39 WWW-Mechanize-1.72.tar.gz [root@ip JESSE]# cpan -i WWW::Mechanize CPAN: Storable loaded ok (v2.20) Reading '