Quick Perl Question


Results 1 to 6 of 6

Thread: Quick Perl Question

  1. #1
    Join Date
    Oct 2003
    Posts
    193

    Quick Perl Question

    I was wondering if there is anyway to install Spreadsheet::WriteExcel without using cpan??.

    I am asking as the admin at my work is being really anal, Im learning perl at the moment and have taken on a task to automate some qa checks against a database and sending out a spreadsheet with the results to who-ever wants them via an email.

    Problem is i only know how to do it on perl and the admin will not let me install cpan or give me the privalages to do so myself, he has basically told me to use the standard tools that have been installed on the servers.

    I do however have full rights to my home directory, is there anyway i can install it in my home directory without cpan and link it or something...

    All help is greatly apprecaited...

  2. #2
    Join Date
    Jan 2003
    Posts
    1,012
    Well lets see.

    Download this; http://search.cpan.org/CPAN/authors/...el-2.16.tar.gz

    Extract it, cd to where you put it, run "perl Makefile.PL" then "make" and then "make install".
    You can tuna piano, but you can't tune a fish.

    http://www.lunar-linux.org/
    It's worth the spin.

    http://www.pclinuxos.com/page.php?7
    Puts the rest to shame.

  3. #3
    Join Date
    Sep 2003
    Location
    Rochester, MN
    Posts
    3,604
    The only problem I see is that make install will try to put it in the system PERL directory, which it sounds like he doesn't have access to. What you might try doing is everything except the make install, then point PERL at the build directory and see if it will pick up the module from there. I think you can do that with the -I switch to PERL (that's an upper-case i in case it ends up looking like an L).

  4. #4
    Join Date
    Oct 2003
    Posts
    193
    cheers guys i will try this and let you know how i got on!!!

  5. #5
    Join Date
    Mar 2003
    Location
    Earth [I think...]
    Posts
    414
    Here's another way to do it (Copied and pasted from http://www.suramya.com/blog/2005/09/...e-perl-tricks/) :

    Installing perl modules can be a pain if you don’t have root access on the server you are installing them. However the creators of Perl did think about this and added a PREFIX switch that we can use to give the module an alternate installation directory. So to install the module in /home/suramya/modules the command we would run is:

    perl Makefile.PL PREFIX=/home/suramya/modules

    Then we follow the regular installation steps of make, make install.

    Once the module is installed we need to tell the Perl scripts where to find the new module, there are a number of ways that we can do this but the one I like is modifying the PERL5LIB enviorment variable. This method has the advantage that we don’t need to modify any of the scripts etc.

    The easiest way to modify the variable is to add a line that looks like this to your .profile or .bashrc file:

    PERL5LIB=/home/suramya/module:/usr/local/lib/perl/5.6.1:/usr/local/share/perl/5.6.1:
    export PERL5LIB

    Hope this helps.

    - Suramya
    --------------------------------------------------
    My Website: http://www.suramya.com
    My Blog: http://www.suramya.com/blog
    Registered Linux User #: 309391
    --------------------------------------------------

    *************************************************
    Disclaimer:
    Any errors in spelling, tact, or fact are transmission errors.
    *************************************************

  6. #6
    Join Date
    Sep 2003
    Location
    Rochester, MN
    Posts
    3,604
    Ah, that would probably be the "correct" way to do it. That's the way I install applications locally, but that's always with an autoconf script and I didn't know if the PERL makefile had a similar ability. Apparently it does.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •