Net::IDN::Encode Build procedure in external dir.?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
The Net::IDN::Encode module converts IDN domains into ASCII and vice versa:

The documented build procedure is:
perl Build.PL
./Build test
./Build install

However, I'm not sure how to install this particular module in an non-root
owned directory, if at all possible. My installation procedure for modules
on typical Unix and Linux systems usually include a PREFIX argument, as in:
perl Makefile.PL PREFIX=/some/external/directory

As noted in Net::IDN::Encode's README at the
module depends on Unicode::Stringprep, which has the same build procedure:

Without quite expecting it to work, I tried: ...
perl Build.PL PREFIX=/some/external/directory
... but PREFIX is obviously unrecognised here, so for both modules the
installation failed at the last 'Build install' step with an expected
permission error:
ERROR: Can't create '/usr/lib/perl5/site_perl/5.14.2/Unicode'
mkdir /usr/lib/perl5/site_perl/5.14.2/Unicode: Permission denied at
/usr/lib/perl5/5.14.2/ExtUtils/ line 494

While I can usually install as root that is not always the case, so I
prefer to place most non-core modules in non-root directories.

Can anyone advise me how this module and other modules that may use similar
build procedures may be installed in a non-root directory?

Many thanks for any advise.


Re: Net::IDN::Encode Build procedure in external dir.?

Quoted text here. Click to load it

For Build.PL the argument is '--install_base /some/dir'; see the
Module::Build documentation. Note that this won't always install things
in quite the same place as MakeMaker's PREFIX parameter, since PREFIX is
a little weird; in fact, MakeMaker's documentation currently recommends
using INSTALL_BASE instead of PREFIX, which matches Module::Build's
--install_base and is more predictable than PREFIX.

If you are maintaining a repository of modules under your home
directory, you may also want to look at the local::lib module, which
will help you set up your environment so modules are installed to and
loaded from there automatically. This also means you can use a CPAN
client to install modules with their dependencies automatically; cpanm
(on CPAN as App::cpanminus) has explicit support for installing into a
local::lib-managed directory.


Re: Net::IDN::Encode Build procedure in external dir.?

Ben Morrow wrote:

Quoted text here. Click to load it
Quoted text here. Click to load it

Installing by Build.PL --install_base flag works perfectly and so does the
methods offered by Net::IDN::Encode to convert IDN strings to/from ASCII.  
I will bear the module management techniques in mind for future use.

Thank you for the clear and detailed explanation!


Site Timeline