[29769] in Perl-Users-Digest
Perl-Users Digest, Issue: 1012 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 7 16:14:27 2007
Date: Wed, 7 Nov 2007 13:14:17 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 7 Nov 2007 Volume: 11 Number: 1012
Today's topics:
Re: problems building perl modules, path question <jimsgibson@gmail.com>
Re: problems building perl modules, path question <ben@morrow.me.uk>
Re: problems building perl modules, path question <mmccaws@comcast.net>
Re: problems building perl modules, path question <elsiddik@gmail.com>
Re: Replace without back reference <jimsgibson@gmail.com>
Unix Daemons in Perl -- Tutorial <elsiddik@gmail.com>
Re: Using perl to watch other programs <bill@ts1000.us>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 07 Nov 2007 09:26:53 -0800
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: problems building perl modules, path question
Message-Id: <071120070926534220%jimsgibson@gmail.com>
In article <1194449784.238931.290970@y27g2000pre.googlegroups.com>,
mmccaws2 <mmccaws@comcast.net> wrote:
>
> So I need to correct this situation before it gets any worse. In an
> ideal world of unix administration what are the practices for
> installing modules when you have multiple users, each with sudo
> access, that need to install modules and modules that require root
> permissions.
Log in as root and do the install to the default location, i.e., don't
tell cpan where to install the modules.
>
> Also, do I uninstall the ones that I have already installed as root or
> do I change file permissions for directories, I really don't
> understand this part of administration.
This is more of a general Unix administration question than a Perl one.
Use the chmod utility to change file protections and use the -R option
to recurse through subdirectories. See 'man chmod' for details. You
generally want to set file protections to 644 for normal files and to
755 for executables and directories.
You generally don't have to uninstall Perl modules, as the installer
will overwrite the existing files with new versions. However, if you
have installed a module in the wrong place, you should delete the old
module files or make sure the new location is higher in the precedence
list (perl -V). Use 'perldoc -l Module' to see where Module.pm is
stored.
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Wed, 7 Nov 2007 16:59:16 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: problems building perl modules, path question
Message-Id: <4g7905-074.ln1@osiris.mauzo.dyndns.org>
Quoth mmccaws2 <mmccaws@comcast.net>:
> On Oct 29, 2:53 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > Quoth Ron Bergin <r...@i.frys.com>:
> >
> > > Try doing:
> >
> > > $sudobash
> > > [pass your login credentials]
> >
> > > #perl-MCPAN -e shell
> >
> > > Note the difference between the $ prompt and the # prompt.
> >
> > It would be better to avoid performing the Makefile.PL and make steps as
> > root, if possible. Since CPAN (at least recent versions) has support for
> > usingsudofor make install, it would be better to take advantage of it.
>
> So, I think I have made a few mistakes here and I need to correct
> them. I had installed several modules by getting into perl -MCPAN -e
> shell using sudo. The reason is I get this error message
>
> $ perl -MCPAN -e shell
> CPAN: File::HomeDir loaded ok (v0.66)
> mkdir /home/mccannm/.cpan/CPAN: Permission denied at /opt/perl_32/lib/
> 5.8.8/CPAN/HandleConfig.pm line 539
>
> when I tried logging in as my self.
> What happened is this, right after the reinstallation of perl, we're
> on 5.8.8 now, I need to install a module that required root access. I
> had tried to install that module previously and it said trying to
> install the module I needed root access. It was the POE module for
> non-blocking ping. I used sudo perl -MCPAN -e shell to intall it.
> Since then I can't install any module without using sudo perl -MCPAN -
> e shell.
What has happened is that running CPAN under sudo has created
/home/mccannm/.cpan as root, so you can't run CPAN as yourself any more.
You need to su(do) to root, and either delete the entire directory or
chown -R it to yourself. Then you need to set CPAN up to use sudo to
install (as yourself):
$ perl -MCPAN -eshell
cpan> o conf make_install_make_command "sudo make"
cpan> o conf mbuild_install_build_command "sudo ./Build"
cpan> o conf commit
cpan> quit
$
You will of course need sudo rights to perform both those commands; but
it seems as though you have localhost=(root) ALL rights anyway.
> Also, do I uninstall the ones that I have already installed as root or
> do I change file permissions for directories, I really don't
> understand this part of administration.
No, all the modules already installed should be fine (you might want to
check that everything under /opt/perl_32/lib is owned by root). It's
just your CPAN config that's been messed up.
Ben
------------------------------
Date: Wed, 07 Nov 2007 10:05:46 -0800
From: mmccaws2 <mmccaws@comcast.net>
Subject: Re: problems building perl modules, path question
Message-Id: <1194458746.175230.155160@i13g2000prf.googlegroups.com>
On Nov 7, 8:59 am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth mmccaws2 <mmcc...@comcast.net>:
>
>
>
> > On Oct 29, 2:53 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > > Quoth Ron Bergin <r...@i.frys.com>:
>
> > > > Try doing:
>
> > > > $sudobash
> > > > [pass your login credentials]
>
> > > > #perl-MCPAN -e shell
>
> > > > Note the difference between the $ prompt and the # prompt.
>
> > > It would be better to avoid performing the Makefile.PL and make steps as
> > > root, if possible. Since CPAN (at least recent versions) has support for
> > > usingsudofor make install, it would be better to take advantage of it.
>
> > So, I think I have made a few mistakes here and I need to correct
> > them. I had installed several modules by getting into perl -MCPAN -e
> > shell using sudo. The reason is I get this error message
>
> > $ perl -MCPAN -e shell
> > CPAN: File::HomeDir loaded ok (v0.66)
> > mkdir /home/mccannm/.cpan/CPAN: Permission denied at /opt/perl_32/lib/
> > 5.8.8/CPAN/HandleConfig.pm line 539
>
> > when I tried logging in as my self.
> > What happened is this, right after the reinstallation of perl, we're
> > on 5.8.8 now, I need to install a module that required root access. I
> > had tried to install that module previously and it said trying to
> > install the module I needed root access. It was the POE module for
> > non-blocking ping. I used sudo perl -MCPAN -e shell to intall it.
> > Since then I can't install any module without using sudo perl -MCPAN -
> > e shell.
>
> What has happened is that running CPAN under sudo has created
> /home/mccannm/.cpan as root, so you can't run CPAN as yourself any more.
> You need to su(do) to root, and either delete the entire directory or
> chown -R it to yourself. Then you need to set CPAN up to use sudo to
> install (as yourself):
>
> $ perl -MCPAN -eshell
> cpan> o conf make_install_make_command "sudo make"
> cpan> o conf mbuild_install_build_command "sudo ./Build"
> cpan> o conf commit
> cpan> quit
> $
>
> You will of course need sudo rights to perform both those commands; but
> it seems as though you have localhost=(root) ALL rights anyway.
>
> > Also, do I uninstall the ones that I have already installed as root or
> > do I change file permissions for directories, I really don't
> > understand this part of administration.
>
> No, all the modules already installed should be fine (you might want to
> check that everything under /opt/perl_32/lib is owned by root). It's
> just your CPAN config that's been messed up.
>
> Ben
well chown -R worked.
now the next part, and sorry for being so dense, But I don't sudo perl
-MCPAN -e shell but run those commands after entering perl -MCPAN -e
shell. Correct?
also the /opt/perl_32/lib/5.8.8/ has a lot of files with read only
permissions. Would the correct approach be chmod -R 644 /opt/perl_32/
lib/5.8.8/ or is that too broad of a command?
$ ls -l /opt/perl_32/lib/5.8.8/
gives
total 4784
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 ActivePerl
-r--r--r-- 1 bin bin 3112 Aug 3 05:50
ActivePerl.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 ActiveState
-r--r--r-- 1 bin bin 2594 Aug 3 05:50
AnyDBM_File.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Apache
drwxr-xr-x 2 root sys 96 Nov 6 21:58 App
dr-xr-xr-x 4 bin bin 96 Nov 2 12:54 Archive
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Attribute
-r--r--r-- 1 bin bin 11794 Aug 3 05:50
AutoLoader.pm
-r--r--r-- 1 bin bin 15699 Aug 3 05:50 AutoSplit.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 B
-r--r--r-- 1 bin bin 28524 Aug 3 05:50 Benchmark.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Bundle
dr-xr-xr-x 3 bin bin 8192 Nov 2 12:54 CGI
-r--r--r-- 1 bin bin 249942 Aug 3 05:50 CGI.pm
dr-xr-xr-x 4 bin bin 8192 Nov 3 07:18 CPAN
-r--r--r-- 1 root sys 441448 Sep 28 00:06 CPAN.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Carp
-r--r--r-- 1 bin bin 7608 Aug 3 05:50 Carp.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Class
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Convert
-r--r--r-- 1 bin bin 19229 Aug 3 05:50 DB.pm
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:54 DBM_Filter
-r--r--r-- 1 bin bin 14415 Aug 3 05:50
DBM_Filter.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Data
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Devel
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:54 Digest
-r--r--r-- 1 bin bin 10316 Aug 3 05:50 Digest.pm
-r--r--r-- 1 bin bin 1899 Aug 3 05:50 DirHandle.pm
-r--r--r-- 1 bin bin 16897 Aug 3 05:50 Dumpvalue.pm
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:54 Encode
-r--r--r-- 1 bin bin 4519 Aug 3 05:50 English.pm
-r--r--r-- 1 bin bin 5170 Aug 3 05:50 Env.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Exporter
-r--r--r-- 1 bin bin 14481 Aug 3 05:50 Exporter.pm
dr-xr-xr-x 6 bin bin 8192 Nov 2 12:54 ExtUtils
-r--r--r-- 1 bin bin 5208 Aug 3 05:50 Fatal.pm
dr-xr-xr-x 3 bin bin 8192 Nov 2 12:54 File
-r--r--r-- 1 bin bin 5405 Aug 3 05:50 FileCache.pm
-r--r--r-- 1 bin bin 6771 Aug 3 05:50
FileHandle.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Filter
-r--r--r-- 1 bin bin 5668 Aug 3 05:50 FindBin.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Font
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Getopt
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:54 HTML
dr-xr-xr-x 5 bin bin 8192 Nov 2 12:54 HTTP
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 I18N
dr-xr-xr-x 36 bin bin 8192 Nov 2 12:55
IA64.ARCHREV_0-thread-multi
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 IO
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 IPC
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 LWP
-r--r--r-- 1 bin bin 21427 Jul 19 23:16 LWP.pm
dr-xr-xr-x 3 bin bin 8192 Nov 2 12:55 Locale
-r--r--r-- 1 bin bin 1141 Nov 27 2003 MD5.pm
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 Math
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 Memoize
-r--r--r-- 1 bin bin 35275 Aug 3 05:50 Memoize.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 Module
-r--r--r-- 1 bin bin 16122 Aug 3 05:50 NEXT.pm
dr-xr-xr-x 5 bin bin 8192 Nov 6 22:04 Net
dr-xr-xr-x 6 bin bin 8192 Nov 2 12:55 PPM
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 PerlIO
-r--r--r-- 1 bin bin 10928 Aug 3 05:50 PerlIO.pm
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 Pod
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 SOAP
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 Search
-r--r--r-- 1 bin bin 1070 Aug 3 05:50
SelectSaver.pm
-r--r--r-- 1 bin bin 13203 Aug 3 05:50
SelfLoader.pm
-r--r--r-- 1 bin bin 8457 Aug 3 05:50 Shell.pm
-r--r--r-- 1 bin bin 28651 Aug 3 05:50 Switch.pm
-r--r--r-- 1 bin bin 4794 Aug 3 05:50 Symbol.pm
drwxr-xr-x 4 root sys 8192 Nov 6 21:58 TAP
dr-xr-xr-x 3 bin bin 8192 Nov 2 12:55 Term
dr-xr-xr-x 4 bin bin 8192 Nov 6 21:58 Test
-r--r--r-- 1 bin bin 28863 Aug 3 05:50 Test.pm
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 Text
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 Thread
-r--r--r-- 1 bin bin 10152 Aug 3 05:50 Thread.pm
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 Tie
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 Time
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 UDDI
-r--r--r-- 1 bin bin 4052 Aug 3 05:50 UNIVERSAL.pm
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 URI
-r--r--r-- 1 bin bin 30307 Nov 5 2004 URI.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 Unicode
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 User
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 WWW
dr-xr-xr-x 8 bin bin 8192 Nov 2 12:55 XML
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 XMLRPC
-r--r--r-- 1 bin bin 838 Aug 3 05:50 abbrev.pl
-r--r--r-- 1 bin bin 1298 Aug 3 05:50 assert.pl
-r--r--r-- 1 bin bin 12844 Aug 3 05:50
attributes.pm
-r--r--r-- 1 bin bin 4238 Aug 3 05:50 autouse.pm
-r--r--r-- 1 bin bin 6524 Aug 3 05:50 base.pm
-r--r--r-- 1 bin bin 7368 Aug 3 05:50 bigfloat.pl
-r--r--r-- 1 bin bin 8959 Aug 3 05:50 bigint.pl
-r--r--r-- 1 bin bin 11937 Aug 3 05:50 bigint.pm
-r--r--r-- 1 bin bin 14966 Aug 3 05:50 bignum.pm
-r--r--r-- 1 bin bin 4476 Aug 3 05:50 bigrat.pl
-r--r--r-- 1 bin bin 10694 Aug 3 05:50 bigrat.pm
-r--r--r-- 1 bin bin 2106 Aug 3 05:50 blib.pm
-r--r--r-- 1 bin bin 2384 Aug 3 05:50 bytes.pm
-r--r--r-- 1 bin bin 758 Aug 3 05:50
bytes_heavy.pl
-r--r--r-- 1 bin bin 1122 Aug 3 05:50 cacheout.pl
-r--r--r-- 1 bin bin 15501 Aug 3 05:50 charnames.pm
-r--r--r-- 1 bin bin 3191 Aug 3 05:50 complete.pl
-r--r--r-- 1 bin bin 11709 Aug 3 05:50 constant.pm
-r--r--r-- 1 bin bin 1993 Aug 3 05:50 ctime.pl
-r--r--r-- 1 bin bin 17400 Aug 3 05:50
diagnostics.pm
-r--r--r-- 1 bin bin 2175 Aug 3 05:50 dotsh.pl
-r--r--r-- 1 bin bin 15275 Aug 3 05:50 dumpvar.pl
-r--r--r-- 1 bin bin 1736 Aug 3 05:50
exceptions.pl
-r--r--r-- 1 bin bin 1019 Aug 3 05:50 fastcwd.pl
-r--r--r-- 1 bin bin 9351 Aug 3 05:50 fields.pm
-r--r--r-- 1 bin bin 2156 Aug 3 05:50 filetest.pm
-r--r--r-- 1 bin bin 1185 Aug 3 05:50 find.pl
-r--r--r-- 1 bin bin 1130 Aug 3 05:50 finddepth.pl
-r--r--r-- 1 bin bin 642 Aug 3 05:50 flush.pl
-r--r--r-- 1 bin bin 1427 Aug 3 05:50 getcwd.pl
-r--r--r-- 1 bin bin 1322 Aug 3 05:50 getopt.pl
-r--r--r-- 1 bin bin 1406 Aug 3 05:50 getopts.pl
-r--r--r-- 1 bin bin 727 Aug 3 05:50 hostname.pl
-r--r--r-- 1 bin bin 1166 Aug 3 05:50 if.pm
-r--r--r-- 1 bin bin 283 Aug 3 05:50 importenv.pl
-r--r--r-- 1 bin bin 3266 Aug 3 05:50 integer.pm
-r--r--r-- 1 bin bin 373 Aug 3 05:50 less.pm
-r--r--r-- 1 bin bin 820 Aug 3 05:50 locale.pm
-r--r--r-- 1 bin bin 1255 Aug 3 05:50 look.pl
-r--r--r-- 1 bin bin 9136 Nov 30 2004 lwpcook.pod
-r--r--r-- 1 bin bin 25458 Nov 30 2004 lwptut.pod
-r--r--r-- 1 bin bin 2216 Aug 3 05:50 newgetopt.pl
-r--r--r-- 1 bin bin 7971 Aug 3 05:50 open.pm
-r--r--r-- 1 bin bin 185 Aug 3 05:50 open2.pl
-r--r--r-- 1 bin bin 185 Aug 3 05:50 open3.pl
-r--r--r-- 1 bin bin 46898 Aug 3 05:50 overload.pm
-r--r--r-- 1 bin bin 316737 Aug 3 05:50 perl5db.pl
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 pod
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 ppm-conf
-r--r--r-- 1 bin bin 1478 Aug 3 05:50 pwd.pl
-r--r--r-- 1 bin bin 276 Aug 3 05:50
shellwords.pl
-r--r--r-- 1 bin bin 7611 Aug 3 05:50 sigtrap.pm
-r--r--r-- 1 bin bin 6139 Aug 3 05:50 sort.pm
-r--r--r-- 1 bin bin 590 Aug 3 05:50 stat.pl
-r--r--r-- 1 bin bin 3292 Aug 3 05:50 strict.pm
-r--r--r-- 1 bin bin 842 Aug 3 05:50 subs.pm
-r--r--r-- 1 bin bin 4806 Aug 3 05:50 syslog.pl
-r--r--r-- 1 bin bin 164 Aug 3 05:50 tainted.pl
-r--r--r-- 1 bin bin 4114 Aug 3 05:50 termcap.pl
-r--r--r-- 1 bin bin 690 Aug 3 05:50 timelocal.pl
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 unicore
-r--r--r-- 1 bin bin 7144 Aug 3 05:50 utf8.pm
-r--r--r-- 1 bin bin 7956 Aug 3 05:50
utf8_heavy.pl
-r--r--r-- 1 bin bin 3731 Aug 3 05:50 validate.pl
-r--r--r-- 1 bin bin 2358 Aug 3 05:50 vars.pm
-r--r--r-- 1 bin bin 4328 Aug 3 05:50 vmsish.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 warnings
-r--r--r-- 1 bin bin 15894 Aug 3 05:50 warnings.pm
------------------------------
Date: Wed, 07 Nov 2007 20:12:44 -0000
From: elsiddik <elsiddik@gmail.com>
Subject: Re: problems building perl modules, path question
Message-Id: <1194466364.325439.231200@z9g2000hsf.googlegroups.com>
On Nov 7, 7:05 pm, mmccaws2 <mmcc...@comcast.net> wrote:
> On Nov 7, 8:59 am, Ben Morrow <b...@morrow.me.uk> wrote:
>
>
>
> > Quoth mmccaws2 <mmcc...@comcast.net>:
>
> > > On Oct 29, 2:53 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > > > Quoth Ron Bergin <r...@i.frys.com>:
>
> > > > > Try doing:
>
> > > > > $sudobash
> > > > > [pass your login credentials]
>
> > > > > #perl-MCPAN -e shell
>
> > > > > Note the difference between the $ prompt and the # prompt.
>
> > > > It would be better to avoid performing the Makefile.PL and make ste=
ps as
> > > > root, if possible. Since CPAN (at least recent versions) has suppor=
t for
> > > > usingsudofor make install, it would be better to take advantage of =
it.
>
> > > So, I think I have made a few mistakes here and I need to correct
> > > them. I had installed several modules by getting into perl -MCPAN -e
> > > shell using sudo. The reason is I get this error message
>
> > > $ perl -MCPAN -e shell
> > > CPAN: File::HomeDir loaded ok (v0.66)
> > > mkdir /home/mccannm/.cpan/CPAN: Permission denied at /opt/perl_32/lib/
> > > 5.8.8/CPAN/HandleConfig.pm line 539
>
> > > when I tried logging in as my self.
> > > What happened is this, right after the reinstallation of perl, we're
> > > on 5.8.8 now, I need to install a module that required root access. I
> > > had tried to install that module previously and it said trying to
> > > install the module I needed root access. It was the POE module for
> > > non-blocking ping. I used sudo perl -MCPAN -e shell to intall it.
> > > Since then I can't install any module without using sudo perl -MCPAN -
> > > e shell.
>
> > What has happened is that running CPAN under sudo has created
> > /home/mccannm/.cpan as root, so you can't run CPAN as yourself any more.
> > You need to su(do) to root, and either delete the entire directory or
> > chown -R it to yourself. Then you need to set CPAN up to use sudo to
> > install (as yourself):
>
> > $ perl -MCPAN -eshell
> > cpan> o conf make_install_make_command "sudo make"
> > cpan> o conf mbuild_install_build_command "sudo ./Build"
> > cpan> o conf commit
> > cpan> quit
> > $
>
> > You will of course need sudo rights to perform both those commands; but
> > it seems as though you have localhost=3D(root) ALL rights anyway.
>
> > > Also, do I uninstall the ones that I have already installed as root or
> > > do I change file permissions for directories, I really don't
> > > understand this part of administration.
>
> > No, all the modules already installed should be fine (you might want to
> > check that everything under /opt/perl_32/lib is owned by root). It's
> > just your CPAN config that's been messed up.
>
> > Ben
>
> well chown -R worked.
>
> now the next part, and sorry for being so dense, But I don't sudo perl
> -MCPAN -e shell but run those commands after entering perl -MCPAN -e
> shell. Correct?
>
> also the /opt/perl_32/lib/5.8.8/ has a lot of files with read only
> permissions. Would the correct approach be chmod -R 644 /opt/perl_32/
> lib/5.8.8/ or is that too broad of a command?
>
> $ ls -l /opt/perl_32/lib/5.8.8/
>
> gives
>
> total 4784
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 ActivePerl
> -r--r--r-- 1 bin bin 3112 Aug 3 05:50
> ActivePerl.pm
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 ActiveState
> -r--r--r-- 1 bin bin 2594 Aug 3 05:50
> AnyDBM_File.pm
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Apache
> drwxr-xr-x 2 root sys 96 Nov 6 21:58 App
> dr-xr-xr-x 4 bin bin 96 Nov 2 12:54 Archive
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Attribute
> -r--r--r-- 1 bin bin 11794 Aug 3 05:50
> AutoLoader.pm
> -r--r--r-- 1 bin bin 15699 Aug 3 05:50 AutoSplit.pm
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 B
> -r--r--r-- 1 bin bin 28524 Aug 3 05:50 Benchmark.pm
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Bundle
> dr-xr-xr-x 3 bin bin 8192 Nov 2 12:54 CGI
> -r--r--r-- 1 bin bin 249942 Aug 3 05:50 CGI.pm
> dr-xr-xr-x 4 bin bin 8192 Nov 3 07:18 CPAN
> -r--r--r-- 1 root sys 441448 Sep 28 00:06 CPAN.pm
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Carp
> -r--r--r-- 1 bin bin 7608 Aug 3 05:50 Carp.pm
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Class
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Convert
> -r--r--r-- 1 bin bin 19229 Aug 3 05:50 DB.pm
> dr-xr-xr-x 2 bin bin 8192 Nov 2 12:54 DBM_Filter
> -r--r--r-- 1 bin bin 14415 Aug 3 05:50
> DBM_Filter.pm
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Data
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Devel
> dr-xr-xr-x 2 bin bin 8192 Nov 2 12:54 Digest
> -r--r--r-- 1 bin bin 10316 Aug 3 05:50 Digest.pm
> -r--r--r-- 1 bin bin 1899 Aug 3 05:50 DirHandle.pm
> -r--r--r-- 1 bin bin 16897 Aug 3 05:50 Dumpvalue.pm
> dr-xr-xr-x 2 bin bin 8192 Nov 2 12:54 Encode
> -r--r--r-- 1 bin bin 4519 Aug 3 05:50 English.pm
> -r--r--r-- 1 bin bin 5170 Aug 3 05:50 Env.pm
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Exporter
> -r--r--r-- 1 bin bin 14481 Aug 3 05:50 Exporter.pm
> dr-xr-xr-x 6 bin bin 8192 Nov 2 12:54 ExtUtils
> -r--r--r-- 1 bin bin 5208 Aug 3 05:50 Fatal.pm
> dr-xr-xr-x 3 bin bin 8192 Nov 2 12:54 File
> -r--r--r-- 1 bin bin 5405 Aug 3 05:50 FileCache.pm
> -r--r--r-- 1 bin bin 6771 Aug 3 05:50
> FileHandle.pm
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Filter
> -r--r--r-- 1 bin bin 5668 Aug 3 05:50 FindBin.pm
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Font
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Getopt
> dr-xr-xr-x 4 bin bin 8192 Nov 2 12:54 HTML
> dr-xr-xr-x 5 bin bin 8192 Nov 2 12:54 HTTP
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 I18N
> dr-xr-xr-x 36 bin bin 8192 Nov 2 12:55
> IA64.ARCHREV_0-thread-multi
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 IO
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 IPC
> dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 LWP
> -r--r--r-- 1 bin bin 21427 Jul 19 23:16 LWP.pm
> dr-xr-xr-x 3 bin bin 8192 Nov 2 12:55 Locale
> -r--r--r-- 1 bin bin 1141 Nov 27 2003 MD5.pm
> dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 Math
> dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 Memoize
> -r--r--r-- 1 bin bin 35275 Aug 3 05:50 Memoize.pm
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 Module
> -r--r--r-- 1 bin bin 16122 Aug 3 05:50 NEXT.pm
> dr-xr-xr-x 5 bin bin 8192 Nov 6 22:04 Net
> dr-xr-xr-x 6 bin bin 8192 Nov 2 12:55 PPM
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 PerlIO
> -r--r--r-- 1 bin bin 10928 Aug 3 05:50 PerlIO.pm
> dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 Pod
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 SOAP
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 Search
> -r--r--r-- 1 bin bin 1070 Aug 3 05:50
> SelectSaver.pm
> -r--r--r-- 1 bin bin 13203 Aug 3 05:50
> SelfLoader.pm
> -r--r--r-- 1 bin bin 8457 Aug 3 05:50 Shell.pm
> -r--r--r-- 1 bin bin 28651 Aug 3 05:50 Switch.pm
> -r--r--r-- 1 bin bin 4794 Aug 3 05:50 Symbol.pm
> drwxr-xr-x 4 root sys 8192 Nov 6 21:58 TAP
> dr-xr-xr-x 3 bin bin 8192 Nov 2 12:55 Term
> dr-xr-xr-x 4 bin bin 8192 Nov 6 21:58 Test
> -r--r--r-- 1 bin bin 28863 Aug 3 05:50 Test.pm
> dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 Text
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 Thread
> -r--r--r-- 1 bin bin 10152 Aug 3 05:50 Thread.pm
> dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 Tie
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 Time
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 UDDI
> -r--r--r-- 1 bin bin 4052 Aug 3 05:50 UNIVERSAL.pm
> dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 URI
> -r--r--r-- 1 bin bin 30307 Nov 5 2004 URI.pm
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 Unicode
> dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 User
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 WWW
> dr-xr-xr-x 8 bin bin 8192 Nov 2 12:55 XML
> dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 XMLRPC
> -r--r--r-- 1 bin bin 838 Aug 3 05:50 abbrev.pl
> -r--r--r-- 1 bin bin 1298 Aug 3 05:50 assert.pl
> -r--r--r-- 1 bin bin 12844 Aug 3 05:50
> attributes.pm
> -r--r--r-- 1 bin bin 4238 Aug 3 05:50 autouse.pm
> -r--r--r-- 1 bin bin 6524 Aug 3 05:50 base.pm
> -r--r--r-- 1 bin bin 7368 Aug 3 05:50 bigfloat.pl
> -r--r--r-- 1 bin bin 8959 Aug 3 05:50 bigint.pl
> -r--r--r-- 1 bin bin 11937 Aug 3 05:50 bigint.pm
> -r--r--r-- 1 bin bin 14966 Aug 3 05:50 bignum.pm
> -r--r--r-- 1 bin bin 4476 Aug 3 05:50 bigrat.pl
> -r--r--r-- 1 bin bin 10694 Aug 3 05:50 bigrat.pm
> -r--r--r-- 1 bin bin 2106 Aug 3 05:50 blib.pm
> -r--r--r-- 1 bin bin 2384 Aug 3 05:50 bytes.pm
> -r--r--r-- 1 bin bin 758 Aug 3 05:50
> bytes_heavy.pl
> -r--r--r-- 1 bin bin 1122 Aug 3 05:50 cacheout.pl
> -r--r--r-- 1 bin bin 15501 Aug 3 05:50 charnames.pm
> -r--r--r-- 1 bin bin 3191 Aug 3
> ...
>
> read more =BB
The chmod 644 command sets the file to be "readable and writable" by
the owner of the account and readable by everybody else.
chmod -R 644 recursively change permissions of directories and their
contents.
chmod -R 644 /opt/perl_32/lib/5.8.8/ will do the job for you.
for more info read chmod man page.
zaher el siddik
http://www.unixshells.nl/
------------------------------
Date: Wed, 07 Nov 2007 09:12:47 -0800
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Replace without back reference
Message-Id: <071120070912473463%jimsgibson@gmail.com>
In article <1194407427.449770.6890@v29g2000prd.googlegroups.com>, howa
<howachen@gmail.com> wrote:
> On 11 6 , 9 45 , Brian McCauley <nobul...@gmail.com> wrote:
> > On Nov 6, 11:18 am, howa <howac...@gmail.com> wrote:
> >
> > > $str =~ s/(C)D/$1F/g;
> > > I need to do these kind of operations a lot, seems using back
> > > reference is slow
> >
> > > Any better or faster approach for the above example?
I thought of another way:
$str = s/CD/CF/g;
It's probably about the same as look-behind, but let's throw it into
the benchmark program and see:
#!/usr/local/bin/perl
use strict;
use warnings;
use Benchmark qw(cmpthese);
my $str = 'ABCDEFGHCDIJCXKLCDMNOPC';
my $s;
cmpthese( 1_000_000, {
'BckRef' => sub{ ($s = $str) =~ s/(C)D/$1F/g; },
'Subst' => sub{ ($s = $str) =~ s/CD/CF/g; },
'LkBnd' => sub{ ($s = $str) =~ s/(?<=C)D/F/g; },
'Index' => sub{
$s = $str;
while( (my $pos = index($s,'CD') ) > -1 ) {
substr($s,($pos+1),1,'F');
}
}
});
Rate BckRef LkBnd Index Subst
BckRef 263158/s -- -47% -61% -73%
LkBnd 500000/s 90% -- -25% -48%
Index 666667/s 153% 33% -- -31%
Subst 970874/s 269% 94% 46% --
Surprising, no?
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Wed, 07 Nov 2007 19:48:31 -0000
From: elsiddik <elsiddik@gmail.com>
Subject: Unix Daemons in Perl -- Tutorial
Message-Id: <1194464911.081523.122000@z9g2000hsf.googlegroups.com>
The word daemon is derived from the Greek word daimon, meaning a
"supernatural being" or "spirit", rather than demon, referring to the
fallen angels or followers of Satan. Some would insist that Unix is
infested with both daemons and demons. In Unix, daemons are typically
started by the root process when the operating system is initialized,
and run in the background indefinitely. Daemons typically spend most
of their time waiting for an event or period when they will perform
some task. Examples of common Internet daemons include WU-Ftpd,
Apache, BIND, and Sendmail. These particular daemon programs are
responsible in part for making the Internet useful, but daemons also
serve other purposes that are not as visible to users. In this
tutorial, we'll learn how easy it is to turn a Perl script into a
daemon process.
Read full tutorial here -- http://www.webreference.com/perl/tutorial/9/
zaher el siddik
------------------------------
Date: Wed, 07 Nov 2007 10:33:26 -0800
From: Bill H <bill@ts1000.us>
Subject: Re: Using perl to watch other programs
Message-Id: <1194460406.672859.277200@22g2000hsm.googlegroups.com>
On Nov 7, 10:14 am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Bill H <b...@ts1000.us>:
>
> > Is there a way in perl to watch what is running on a server and close
> > out applications that appear to be hung?
>
> > I am running a perl bulletin board (YaBB) and have been having an
> > issue where it seems to hang occasionally and not exit, causing server
> > usage to go up to the point where the server locks up. While I am
> > trying to determine what is causing this, I would like to do is be
> > able to close an instance of the program if it is running for more
> > than 1 minute, can this be done with a perl program (maybe running as
> > a cron job)?
>
> The easiest way to do this is with setrlimit: then the OS will kill it
> for you.
>
> In general, you can use Proc::ProcessTable to see what's going on with
> the other processes on the machine.
>
> Ben
What is setrlimit?
Bill H
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 1012
***************************************