cpan

How can I extract URL and link text from HTML in Perl?

十年热恋 提交于 2019-11-26 20:22:19
I previously asked how to do this in Groovy. However, now I'm rewriting my app in Perl because of all the CPAN libraries. If the page contained these links: <a href="http://www.google.com">Google</a> <a href="http://www.apple.com">Apple</a> The output would be: Google, http://www.google.com Apple, http://www.apple.com What is the best way to do this in Perl? Andy Lester Please look at using the WWW::Mechanize module for this. It will fetch your web pages for you, and then give you easy-to-work with lists of URLs. my $mech = WWW::Mechanize->new(); $mech->get( $some_url ); my @links = $mech-

Installing modules using Strawberry Perl

[亡魂溺海] 提交于 2019-11-26 19:01:54
问题 Until now I used ActiveState's ActivePerl, and used the ppm for installing modules. Last week I moved to Strawberry Perl, but I don't know how I should install modules using Strawberry Perl. What is some information on how module installation is done using Strawberry Perl or is there some link on how to install new modules? 回答1: You can still use ppm , but it is not recommended. Run CPAN client from the Strawberry Perl or Strawberry Perl (64-bit) , sub folder Tools , entry in the Start menu.

How do I get a list of installed CPAN modules?

做~自己de王妃 提交于 2019-11-26 18:49:30
问题 Aside from trying perldoc <module name> individually for any CPAN module that takes my fancy or going through the file system and looking at the directories I have no idea what modules we have installed. What's the easiest way to just get a big list of every CPAN module installed? From the command line or otherwise. 回答1: This is answered in the Perl FAQ, the answer which can be quickly found with perldoc -q installed . In short, it comes down to using ExtUtils::Installed or using File::Find ,

I installed a module successfully with CPAN, but perl can't find it. Why?

旧城冷巷雨未停 提交于 2019-11-26 16:26:41
问题 I installed a CPAN module like this: cpan Acme According to the output, the installation was successful: Running install for module 'Acme' ... All tests successful. Files=2, Tests=3, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.04 cusr 0.00 csys = 0.06 CPU) Result: PASS INGY/Acme-1.11111111111.tar.gz /usr/bin/make test -- OK Running make install Manifying 1 pod document Installing /home/foo/perl5/lib/perl5/Acme.pod Installing /home/foo/perl5/lib/perl5/Acme.pm Installing /home/foo/perl5/man/man3

Can a Perl script install its own CPAN dependencies?

删除回忆录丶 提交于 2019-11-26 16:18:43
问题 I have a Perl script that has two dependencies that exist in CPAN. What I'd like to do is have the script itself prompt the user to install the necessary dependencies so the script will run properly. If the user needs to enter in some kind of authentication to install the dependencies that's fine: what I'm trying to avoid is the following workflow: Run script -> Watch it fail -> Scour CPAN aimlessly -> Lynch the script writer Instead I'm hoping for something like: Run script -> Auto-download

How to make “use My::defaults” with modern perl & utf8 defaults?

橙三吉。 提交于 2019-11-26 14:28:51
问题 I want make a module for my own "default use", e.g.: use My::perldefs; with the following content (mostly based on tchrist's post.) use 5.014; use strict; use features qw(switch say state); no warnings; use warnings qw(FATAL closed threads internal debugging pack substr malloc unopened portable prototype inplace io pipe unpack regexp deprecated exiting glob digit printf utf8 layer reserved parenthesis taint closure semicolon); no warnings qw(exec newline); use utf8; use open qw(:std :utf8);

Which cpan installer is the right one? (CPAN.pm/CPANPLUS/cpanminus)

喜欢而已 提交于 2019-11-26 12:08:14
问题 There are multiple installers for cpan modules available; I know of at least CPAN.pm (comes with perl,) CPANPLUS, and cpanminus. What is the difference between the three? What situations call for using one over the other? Are there other module installers I should know about? 回答1: CPAN.pm ( cpan ) is the original client. It comes with Perl, so you already have it. It has the most features. It has a lot of configuration options to customize the way it works, though virtually everyone accepts

How can I install a specific version of a set of Perl modules?

我的未来我决定 提交于 2019-11-26 11:51:32
问题 I\'m tasked with replicating a production environment to create many test/sit environments. One of the things I need to do is build up Perl, with all the modules which have been installed (including internal and external modules) over the years. I could just use CPAN.pm autobundle, but this will result in the test environment having much newer versions of the external modules that production has. What is the easiest/best way to get and install (a lot of) version specific Perl modules. 回答1:

How do I tell CPAN to install all dependencies?

会有一股神秘感。 提交于 2019-11-26 11:46:16
问题 How do I tell CPAN to install all dependencies? I tried setting these in cpan : cpan> o conf prerequisites_policy follow cpan> o conf commit I still had to answer \"y\" a couple of times (but fewer than before it feels like). Is there a way to get it to always go ahead and install? I want to make it unattended. It would seem that I want a flag to always trust CPAN to do the right thing, and if it suggests an answer I would like to follow it (always hit Enter when it asks something). 回答1: Here

How can I extract URL and link text from HTML in Perl?

痞子三分冷 提交于 2019-11-26 07:34:49
问题 I previously asked how to do this in Groovy. However, now I\'m rewriting my app in Perl because of all the CPAN libraries. If the page contained these links: <a href=\"http://www.google.com\">Google</a> <a href=\"http://www.apple.com\">Apple</a> The output would be: Google, http://www.google.com Apple, http://www.apple.com What is the best way to do this in Perl? 回答1: Please look at using the WWW::Mechanize module for this. It will fetch your web pages for you, and then give you easy-to-work