Re: Need some help on installing modules...
On Sun, January 16, 2011 5:29 pm, Levan, Jerry wrote: Is doing a: sudo perl -MCPAN -e shell The standard way of preparing to install modules? Seems like root might only be needed for actual installation... Current versions of CPAN can be configured to request a sudo password at the install step, while running the rest with normal permissions. IIRC (I use cpanp, and I haven't had to set this up in a while): o conf make_install_make_command 'sudo make' o conf mbuild_install_build_command 'sudo ./Build' o conf commit In the CPAN shell should set it up for you. Depending on what order you've done things in, some temp folders may have been created with root-only access at this point, which you might need to change. (That is: If they were created by a 'sudo' run, they'll have root-only access. Otherwise they'll have access for your user.) You also don't need to go to the shell, and 'cpan' should be installed as a stand-alone script: cpan i Module::Name But all of that is basically just making things a bit less verbose and noisy. (And the one safety of not running tests as root. Note that some module tests will _fail_ if run as root...) Daniel T. Staal --- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---
Re: Need some help on installing modules...
On Sun, Jan 16, 2011 at 20:59, John Delacour j...@bd8.com wrote: At 17:29 -0500 16/01/2011, Levan, Jerry wrote: Is doing a: sudo perl -MCPAN -e shell The standard way of preparing to install modules? Seems like root might only be needed for actual installation... With sudo you are superuser; that's quite good enough. I never do it that way. I just type sudo cpan, as I said. In fact I don't usually do that because I work mainly with my own installation of perl, so I do $ cd /usr/local/bin; sudo ./cpan in order to get the modules installed where I want them and not in the Apple installation. I wouldn't trust Apple to overwrite their own installation. I trust them to take my money and not much else. JD A more modern way of doing this is to install your own version of Perl 5 with [perlbrew][1] and then use [cpanm][2] to manage your CPAN installs. You may also find [this Stack Overflow question][3] useful. By using a non-system version of Perl 5, you will not be susceptible to problems such as the 2009-001 Apple security update [breaking][4] Perl 5. [1]: http://search.cpan.org/dist/App-perlbrew/lib/App/perlbrew.pm [2]: http://search.cpan.org/dist/App-cpanminus/lib/App/cpanminus.pm [3]: http://stackoverflow.com/questions/3718153/how-can-i-install-perl-version-under-my-home-using-perlbrew [4]: http://www.theregister.co.uk/2009/02/16/apple_update_perl_breakage/ -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.
Re: Need some help on installing modules...
At 11:13 -0500 16/01/2011, Levan, Jerry wrote: I have an iPad and I have a Postgresql database on my home server. I have turned on the MacOS(client) VPN on the mac mini that I use as my home server and can access my home network in a secure fashion... It turns out that once upon a time I wrote a perl cgi that allowed me to access postgresql and display the results of selections in a html table. It appears that I need to install DBI and DBD for Postgresql. Unfortunately I have pretty much forgotten most of my Perl ( Sh*t happens when you get into your seventies...) Could some kind soul give me a quick guide on how to install the necessary modules to enable the cgi? Presuming you have the developer tools installed then use CPAN. I've recently installed DBI and DBD::SQLite on my Mac Mini without any complaints. I see that I am excluded from getting DBD:Pg because I can't answer a simple question: Configuring DBD::Pg 2.17.2 Path to pg_config? You tell me! Use of uninitialized value $ENV{POSTGRES_HOME} ... But no doubt as a user of Pg and 4 years my senior you will be able to answer it. 21:41:50 User:jd Cwd: /usr/lib ➔ sudo cpan Password: Terminal does not support AddHistory. cpan shell -- CPAN exploration and modules installation (v1.9402) Enter 'h' for help. cpan[1] install DBI DBD::Pg CPAN: Storable loaded ok (v2.18) JD
Re: Need some help on installing modules...
On Jan 16, 2011, at 4:53 PM, John Delacour wrote: At 11:13 -0500 16/01/2011, Levan, Jerry wrote: I have an iPad and I have a Postgresql database on my home server. I have turned on the MacOS(client) VPN on the mac mini that I use as my home server and can access my home network in a secure fashion... It turns out that once upon a time I wrote a perl cgi that allowed me to access postgresql and display the results of selections in a html table. It appears that I need to install DBI and DBD for Postgresql. Unfortunately I have pretty much forgotten most of my Perl ( Sh*t happens when you get into your seventies...) Could some kind soul give me a quick guide on how to install the necessary modules to enable the cgi? Presuming you have the developer tools installed then use CPAN. I've recently installed DBI and DBD::SQLite on my Mac Mini without any complaints. I see that I am excluded from getting DBD:Pg because I can't answer a simple question: Configuring DBD::Pg 2.17.2 Path to pg_config? You tell me! Use of uninitialized value $ENV{POSTGRES_HOME} ... But no doubt as a user of Pg and 4 years my senior you will be able to answer it. 21:41:50 User:jd Cwd: /usr/lib ➔ sudo cpan Password: Terminal does not support AddHistory. cpan shell -- CPAN exploration and modules installation (v1.9402) Enter 'h' for help. cpan[1] install DBI DBD::Pg CPAN: Storable loaded ok (v2.18) JD I compiled postgresql ( 8.4.4) myself and pg_config is living in /usr/local/bin but I have set /usr/local/bin as the target for all of the 'binarys' for the install. I am not sure how to use cpan properly ( espcially the install part ) I got a cpan shell by perl -MCPAN -e shell and did a 'install Bundle::DBD::Pg After much stuff flew by the install failed because I did not have root access... I did a sudo -s and restarted cpan. I did the install again and did not notice that DBD::Pg was installed ( DBI evidently was ok... I then did a 'install DBD:Pg' and it appeared that some errors were made and the install did not take place. I went ahead and did a force install and much to my surprise, my rempgsql.cgi worked! I have been able to connect to my db via http using the VPN and have done selects and inserts successfully. ( The auxiliary documentation is missing and the describe function does not work for schema qualified names). Safari forces all of the columns to fit on the screen which can make for very small entires ;( but I can zoom the window and read the table ok. The highest version of DBD::Pg I found was was 2.17.2 Is doing a: sudo perl -MCPAN -e shell The standard way of preparing to install modules? Seems like root might only be needed for actual installation... Thanks Jerry
Re: Need some help on installing modules...
At 17:29 -0500 16/01/2011, Levan, Jerry wrote: Is doing a: sudo perl -MCPAN -e shell The standard way of preparing to install modules? Seems like root might only be needed for actual installation... With sudo you are superuser; that's quite good enough. I never do it that way. I just type sudo cpan, as I said. In fact I don't usually do that because I work mainly with my own installation of perl, so I do $ cd /usr/local/bin; sudo ./cpan in order to get the modules installed where I want them and not in the Apple installation. I wouldn't trust Apple to overwrite their own installation. I trust them to take my money and not much else. JD