cpan

Retrying an operation after an exception: Please criticize my code

假如想象 提交于 2019-12-07 10:27:27
问题 My Perl application uses resources that become temporarily unavailable at times, causing exceptions using die . Most notably, it accesses SQLite databases that are shared by multiple threads and with other applications using through DBIx::Class . Whenever such an exception occurs, the operation should be retried until a timeout has been reached. I prefer concise code, therefore I quickly got fed up with repeatedly typing 7 extra lines for each such operation: use Time::HiRes 'sleep'; use Carp

CPAN shell runs out of memory. How can I give it more memory on Unix?

时光毁灭记忆、已成空白 提交于 2019-12-07 09:48:50
问题 I'm getting an Out of memory! message for all installs. I've never used cpan before and I'm not really sure how it works. I did a ulimit on the /.cpan directory and it resulted in unlimited. Here's what I'm looking at: [/usr/bin]# perl -MCPAN -e shell Terminal does not support AddHistory. cpan shell -- CPAN exploration and modules installation (v1.7602) ReadLine support available (try 'install Bundle::CPAN') cpan> install Term::Readline CPAN: Storable loaded ok Going to read /.cpan/Metadata

How can I tell cpan to change the target for the module installation?

倖福魔咒の 提交于 2019-12-07 09:34:00
问题 When I installed perl from the source the first nice surprise was that without doing something all module installed from now on were available to the new perl. Since I didn't find one module on cpan that comes with my OS I have to use for some scripts the onboard-perl. For one of these scripts I would like to install Text::Format or Text::Autoformat (didn't find the docu for that module on cpan). My question: how can I tell cpan to install the module this one time for the OS-distro-perl? 回答1:

perl “…/config.h, needed by `Makefile'” not working after OSX Lion upgrade

亡梦爱人 提交于 2019-12-07 01:02:54
问题 SOLVED. See at bottom. Just upgraded to OSX Lion and trying to get my Perl install running again: sudo /usr/bin/perl -MCPAN -e 'install "MODULENAME"' with any value of MODULENAME that I tried (e.g. JSON ) produces: ... Checking if your kit is complete... Looks good Writing Makefile for JSON make: *** No rule to make target `/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/config.h', needed by `Makefile'. Stop. MAKAMAKA/JSON-2.53.tar.gz /Developer/usr/bin/make -- NOT OK I can't find

How do I write an HTTP server in Perl?

回眸只為那壹抹淺笑 提交于 2019-12-07 00:55:52
问题 Is there a webserver or HTTP server module in the Perl standard library or in CPAN or elsewhere? I guess I'm looking for the equivalent of Python 3's http.server module. Thanks! 回答1: In addition to HTTP::Daemon, I would recommend taking a look at HTTP::Server::Simple which indeed is very easy to use. 回答2: See HTTP::Daemon 回答3: Here are a few more: Catalyst::Engine::HTTP Net::Server 来源: https://stackoverflow.com/questions/1904420/how-do-i-write-an-http-server-in-perl

Which module do I need when I got error info “Can't locate getopts.pl in @INC…”

人盡茶涼 提交于 2019-12-06 15:34:23
I run this command in my macOS $ perl ~/Desktop/blif2cnf.pl and got this error info: Can't locate getopts.pl in @INC (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /Users/Frank/Desktop/blif2cnf.pl line 10. In my linux 16.04, such problem can be solved by following this answer

What's the fastest way to get CRUD over CGI on a database handle in Perl?

我怕爱的太早我们不能终老 提交于 2019-12-06 03:10:41
问题 TL;DR: Want to write CGI::CRUD::Simple (a minimalist interface module for CGI::CRUD), but I want to check first if i overlooked a module that already does that. I usually work with applications that don't have the niceties of having frameworks and such already in place. However, a while ago i found myself in a situation where i was asking myself: "Self, i have a DBI database handle and a CGI query object, isn't there a module somewhere that can use this to give me some CRUD so i can move on

Automatically correct Lingua::LinkParser include lib path

雨燕双飞 提交于 2019-12-05 19:27:38
I'm building a script that will run on an EC2 instance that will automatically install our required packages and modules. I'm having an issue with Perl module Lingua::LinkParser . During compile it complains LinkParser.xs:5:27: error: link-includes.h: No such file or directory On Ubuntu link-includes.h is provided by package link-grammar and is installed in /usr/include/link-grammar/. However Lingua::LinkParser's Makefile.PL is hard-coded(?) to look in /usr/local/include/link-grammar/. Is there simple-ish way to resolve this issue? daxim Distroprefs Best practice for using slightly modifying

Using perl within Objective-C?

℡╲_俬逩灬. 提交于 2019-12-05 16:35:26
CPAN has a ton of very useful libraries. Outside of porting them to Objective-C, is there is method to embed perl code in Objective-C on iOS? I am particularly interested in using Spreadsheet::Read to read Excel file data (and no, I don't want to force users to re-save their files as CSV). Have you read perldoc perlembed , which documents how to embed perl in a C program? Run the perl script with NSTask(). 来源: https://stackoverflow.com/questions/5533289/using-perl-within-objective-c

How can I create a portable strawberry with extra bundled modules?

∥☆過路亽.° 提交于 2019-12-05 16:05:09
The portable strawberry perl is a godsend-- I can bundle it into an NSIS installer along with the actual scripts and have the user double click it. However, I'm still having to install CPAN modules that our scripts need, manually on each user's computer. Is there a portable way to 'inject' cpan modules into strawberry perl's portable version? Would it be a good idea to take the portable strawberry on a development machine, install modules via CPAN, and re-zip it for distribution? (I imagine I'd need to fix the install location to c:\custom-perl or something if I do this). Anyone know of a more