Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Background: I'm a solo dev; my current project is a web application. This issue concerns my local machine. My system (Ubuntu 9.10) requires perl to run; I suspect it figures heavily in some aspects of GNOME. Meanwhile, I wish to develop in Perl, and I downloaded many modules using cpan, eventually overwriting something used in the system UI and breaking it, which led to a clean OS install.

A couple Monks suggested that I not do that stupid thing; instead, that I install a second perl executable, with its own configurations and module library. This makes excellent sense. I wrote, "I will leave the system perl and its libraries alone; if I install an application that requires modules, I'll let Synaptic take care of the dependencies. I'll compile a distinct development perl somewhere else and use cpan to install whatever I like there." I felt silly for not doing this from Go.

Now, I've spent a full, 24-hour day trying to do just that. I downloaded the perl tarball from CPAN/src and walked through the install -- I thought with not too much trouble, succeeding on only the second try. Then I tried to get cpan working so I could install modules, the object of the exercise. I have utterly failed.

I have googled extensively on the topic, read docs on cpan itself and on Module::Build. I have edited MyConfig.pm directly and using o conf init. I have chowned and chgrped. All I appear to have done of lasting value, through carelessly doing sudo cpan at one point, is to pollute my system perl libraries again.

How does one install a second perl for development purposes?

I have two relevant folders, /lab and /ark. I want the development perl to be somewhere in the /lab path; I'm aiming for a hashbang line of #!/lab/bin/perl. I'd like that perl to search /lab/lib/perl only and for all modules associated with development to reside in that path only, except for project-specific modules which I will load in project scripts with use lib. I want all downloaded tarballs -- perl, perl modules, anything of that nature -- to be stored in /ark/perl, where they can be backed up at leisure. I'd prefer to be able to restore from tarballed backup (at least some of) the hundreds of modules I downloaded before pressing the Big Button. (My net connection is not the best, so redownloading is not always optimum.) I do not want to touch system perl for any reason; for that matter, I'd as soon download any tool the install requires and install it to /lab/bin, although that might be excessive.

I think I've got a good perl install along these lines but I'm not sure and don't know how to prove it. It runs a simple script, anyway. I'm pretty sure cpan is fubar. I've deleted all traces of the old .cpan folder, since I intend never to use cpan again to tinker with system perl. But I can't seem to eliminate all traces of cpan from both installs and start over.

I'm a tryer and a reader; I don't mind hard study. But most searches for "install perl", "install cpan" presume it's the first and only install; or the pages refer to obscure systems, installing under peculiar constraints, or the text is simply way out of date. Diligent examination of docs leads me down blind alleys. Searches for "install second perl executable", "install perl for development", and so forth founder on the common nature of the words.

Here's sample (abbreviated) output from cpan when trying to install Smart::Commentsfor the seventh time:

cpan[2]> install Smart::Comments CPAN: Storable loaded ok (v2.18) Going to read '/ark/cpan/Metadata' Database was generated on Sat, 20 Feb 2010 10:45:55 GMT Running install for module 'Smart::Comments' CPAN: YAML loaded ok (v0.71) Running make for C/CH/CHORNY/Smart-Comments-1.0.4.tar.gz CPAN: Digest::SHA loaded ok (v5.48) CPAN: Compress::Zlib loaded ok (v2.024) Checksum for /ark/cpan/sources/authors/id/C/CH/CHORNY/Smart-Comments-1 +.0.4.tar.gz ok ... (much output; looks good) ... Building Smart-Comments CHORNY/Smart-Comments-1.0.4.tar.gz ./Build --install_base /lab/perl --install_base /lab/perl -- OK Running Build test t/00.load.t ................. 1/1 # Testing Smart::Comments 1.0.4 t/00.load.t ................. ok ...(many more tests, ok)... All tests successful. Files=24, Tests=119, 1 wallclock secs ( 0.09 usr 0.03 sys + 1.17 cu +sr 0.11 csys = 1.40 CPU) Result: PASS CHORNY/Smart-Comments-1.0.4.tar.gz ./Build test -- OK Running Build install Prepending /ark/cpan/build/Smart-Comments-1.0.4-Sjn7Vr/blib/arch /ark/ +cpan/build/Smart-Comments-1.0.4-Sjn7Vr/blib/lib to PERL5LIB for 'inst +all' Building Smart-Comments !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! ERROR: Can't create '/usr/local/man/man3' Do not have write permissions on '/usr/local/man/man3' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! at /usr/local/share/perl/5.10.0/Module/Build/Base.pm line 3326 CHORNY/Smart-Comments-1.0.4.tar.gz ./Build install -- NOT OK ---- You may have to su to root to install the package (Or you may want to run something like o conf make_install_make_command 'sudo make' to raise your permissions.Failed during this command: CHORNY/Smart-Comments-1.0.4.tar.gz : install NO

...and we're back to the cpan prompt. This makes no sense to me. Okay, I've got the build taking place in /ark, which isn't best but it's tolerable for now.

But why is /usr/local/share/perl/5.10.0/Module/Build/Base.pm executing? How can I force cpan to work only from the new dev perl? Why the error trying to install man pages? I don't mean why does it fail; those are the system man page folders. I mean, why is it trying to do that?

Here's ~/.cpan/CPAN/MyConfig.pm:

$CPAN::Config = { 'applypatch' => q[], 'auto_commit' => q[1], 'build_cache' => q[2048], 'build_dir' => q[/ark/cpan/build], 'build_dir_reuse' => q[0], 'build_requires_install_policy' => q[yes], 'bzip2' => q[/bin/bzip2], 'cache_metadata' => q[1], 'check_sigs' => q[0], 'colorize_debug' => q[black on_white], 'colorize_output' => q[1], 'colorize_print' => q[black], 'colorize_warn' => q[bold red on_white], 'commandnumber_in_prompt' => q[1], 'connect_to_internet_ok' => q[1], 'cpan_home' => q[/ark/cpan], 'curl' => q[/usr/bin/curl], 'ftp' => q[/usr/bin/ftp], 'ftp_passive' => q[1], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gpg' => q[/usr/bin/gpg], 'gzip' => q[/bin/gzip], 'halt_on_failure' => q[0], 'histfile' => q[/ark/cpan/histfile], 'histsize' => q[1000], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[/ark/cpan/sources], 'load_module_verbosity' => q[v], 'lynx' => q[], 'make' => q[/usr/bin/make], 'make_arg' => q[], 'make_install_arg' => q[], 'make_install_make_command' => q[/usr/bin/make], 'makepl_arg' => q[LIB=/lab/perl/lib INSTALLMAN1DIR=/lab/perl/man/man +1 INSTALLMAN3DIR=/lab/perl/man/man3 INSTALLSCRIPT=/lab/bin INSTALLBIN +=/lab/bin], 'mbuild_arg' => q[--install_base /lab/perl], 'mbuild_install_arg' => q[], 'mbuild_install_build_command' => q[./Build], 'mbuildpl_arg' => q[--lib=/lab/perl/lib --installman1dir=/lab/perl/m +an/man1 --installman3dir=/lab/perl/man/man3 --installscript=/lab/bin +--installbin=/lab/bin], 'ncftp' => q[], 'ncftpget' => q[], 'no_proxy' => q[], 'pager' => q[/usr/bin/less], 'patch' => q[/usr/bin/patch], 'perl5lib_verbosity' => q[v], 'prefer_installer' => q[MB], 'prefs_dir' => q[/ark/cpan/prefs], 'prerequisites_policy' => q[follow], 'scan_cache' => q[atstart], 'shell' => q[/bin/bash], 'show_unparsable_versions' => q[0], 'show_upload_date' => q[0], 'show_zero_versions' => q[0], 'tar' => q[/bin/tar], 'tar_verbosity' => q[v], 'term_is_latin' => q[1], 'term_ornaments' => q[1], 'test_report' => q[0], 'trust_test_report_history' => q[0], 'unzip' => q[/usr/bin/unzip], 'urllist' => [q[ftp://cpan-sj.viaverio.com/pub/CPAN/], q[ftp://cpan. +erlbaum.net/CPAN/], q[ftp://cpan.hexten.net/], q[ftp://cpan.llarian.n +et/pub/CPAN/], q[ftp://cpan.mirrors.tds.net/pub/CPAN], q[ftp://cpan.n +etnitco.net/pub/mirrors/CPAN/], q[ftp://cpan.pair.com/pub/CPAN/], q[f +tp://cpan.uchicago.edu/pub/CPAN/], q[ftp://ftp-mirror.internap.com/pu +b/CPAN/], q[ftp://ftp.cise.ufl.edu/pub/mirrors/CPAN/], q[ftp://ftp.ep +ix.net/pub/languages/perl/], q[ftp://ftp.ncsu.edu/pub/mirror/CPAN/], +q[ftp://ftp.ndlug.nd.edu/pub/perl/], q[ftp://ftp.osuosl.org/pub/CPAN/ +], q[ftp://ftp.uwsg.iu.edu/pub/perl/CPAN/]], 'use_sqlite' => q[0], 'wget' => q[/usr/bin/wget], 'yaml_load_code' => q[0], 'yaml_module' => q[YAML], }; 1; __END__

Near as I can tell, I've specified where I want the dev module man pages; but those settings aren't respected. (The wrong Build.PL?)

I have a sneaking feeling that I'm missing some critical piece of information, something that prevents my report here from being comprehensive. If I'm told what to look for, I'll add it.

I'm prepared to set fire to the entire current install if I must but obviously, I'd be most grateful++ to the least intensive solution.

Update: Thanks to all for replies.

ikegami suggests one perl, two module libraries. That's a thought but I'd like to build dev perl with debugging and threading support. I think 753430 is a good pointer, though, to installing cpan in my case; thank you.

AriSoft's virtual computer approach may be above my level of expertise.

$ /lab/bin/perl -V
Summary of my perl5 (revision 5 version 10 subversion 1) configuration +: Platform: osname=linux, osvers=2.6.31-19-generic, archname=i686-linux uname='linux oz 2.6.31-19-generic #56-ubuntu smp thu jan 28 01:26: +53 utc 2010 i686 gnulinux ' config_args='' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe -fstack- +protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT +S=64', optimize='-O2 -g', cppflags='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector + -I/usr/local/include' ccversion='', gccversion='4.4.1', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/lib64 libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl +.a gnulibc_version='2.10.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fs +tack-protector' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING PERL_DONT_CREATE_GVSV PERL_MALLOC_WR +AP USE_FAST_STDIO USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Feb 20 2010 06:21:34 @INC: /lab/lib/perl5/5.10.1 /lab/lib/perl5/5.10.1 .

Thanks redgreen! I think ./Configure -Dprefix=/lab leads the right way. I can study available options for that, too.

More:

JavaFan gets ++ for somewhat more detail. I don't need Daddy to hold my hand when I go p-p but a firm, friendly grip on my arm when I totter (dodder?) is highly welcome.

Upvoted Corion for seeing my perspective. My plan is to let all system components strictly alone, unless I mean to tinker with them. I'll play Engineer on remotehost; I may even rm its system perl and install a duplicate of my lab perl there. That should streamline things. If not, <plug>x10hosting.com tech support is extremely responsive.</plug>.


In reply to Installing a Second perl by Xiong

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-29 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found