Archive | Perl RSS feed for this section

Perl – CPAN – auto yes to all dependencies

25 Aug
$> cpan
cpan> o conf prerequisites_policy follow
cpan> o conf commit
cpan> exit

Perl – copying modules from one machine to another – upgrading

18 Aug

Do this as root.

Run this on your old/source machine:

bash perl -MCPAN -e autobundle

it will create something like /root/.cpan/Bundle/

copy this file to your new machine (in /root/.cpan/Bundle) and run:

perl -MCPAN -e 'install Bundle::Snapshot_xxx'

Perl – list all installed modules

18 Aug

From command line, as root:

perl -MCPAN -e 'print CPAN::Shell->r '

CPAN automatically follow dependencies

22 Jan

$> cpan
cpan> o conf prerequisites_policy follow
cpan> o conf commit
cpan> quit

Install Perl modules using CPAN without Root access

22 Mar

Just need to set a few conf variables, you can do this when first setting up CPAN or if you already have:

$> perl -MCPAN -e shell
$> o conf                          # see current configuration
$> o conf makepl_arg  PREFIX=/somewhere/writable   # change the PREFIX
$> o conf make_install_arg INSTALLMAN3DIR=/somewhere/writable    # change where man's will go
$> o conf commit   # save

Now you should be able to do standard “install XML::XSLT” type commands and have all dependencies resolved etc.

Remember to include the /somewhere/writable path (@INC or lib) in your scripts.

Cygwin Perl

24 Jan

Run “o conf” to see configuration

Then “o conf urllist push ” # this is for options which have multiple entries
Otherwise “o conf wget /usr/bin/wget” # only one option

To commit: “o conf commit”

Perl Win32::OLE WinHttp( cannot download binary

31 Mar

The default for this module is to download the response as Text.

You can change this on about line 421: where it says:

$body = $winhttp_obj->ResponseText();    # This does text only

change it to:

$body = $winhttp_obj->ResponseBody();   # To get binary