[24208] in Perl-Users-Digest
Perl-Users Digest, Issue: 6400 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 14 14:05:57 2004
Date: Wed, 14 Apr 2004 11:05:09 -0700 (PDT)
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, 14 Apr 2004 Volume: 10 Number: 6400
Today's topics:
'my' array variables avoid memory leaks? (Yash)
Re: 'my' array variables avoid memory leaks? <1usa@llenroc.ude>
Re: 3x3 simple puzzle <perl@my-header.org>
Re: 3x3 simple puzzle <perl@my-header.org>
Re: 3x3 simple puzzle ctcgag@hotmail.com
[ANNOUNCE] Zoidberg 0.51 <j.g.karssenberg@student.utwente.nl>
ANNOUNCE: CGI::Session::MembersArea V 1.11 <ron@savage.net.au>
ANNOUNCE: Javascript::MD5 V 1.02 <ron@savage.net.au>
ANNOUNCE: List::SkipList v0.51 - Perl implementation of <perl_ann_skiplist_50.20.wlkngowl@spamgourmet.com>
Re: Can you use the "fork" function in Windows? <wherrera@lynxview.com>
Re: Can you use the "fork" function in Windows? <roel-perl@st2x.net>
Re: CGI Perl on IIS <me@privacy.net>
Re: Changing from C thought to Perl (Anno Siegel)
Re: Changing from C thought to Perl <bmb@ginger.libs.uga.edu>
Re: Changing from C thought to Perl <jwillmore@remove.adelphia.net>
Re: Changing from C thought to Perl <xxala_qumsiehxx@xxyahooxx.com>
debian: how to install/maintain perl packages? <friendly@yorku.ca>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Apr 2004 01:13:48 -0700
From: yashgt@yahoo.com (Yash)
Subject: 'my' array variables avoid memory leaks?
Message-Id: <5a373b1d.0404140013.6122d782@posting.google.com>
Here is an unexpected behavior in Perl:
#!/usr/bin/perl
$line=readline STDIN;
while ($line ne "") {
chomp $line; # remove newline from $line
@mlsFields = split(/,/,$line);
$line=readline STDIN;
}
When I run this program on HP-Ux using
cat myfile.txt | a.pl
and monitor the memory usage using top,
I see the memory continuously increasing from
CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU
COMMAND
0 pts/0 21224 dilbert 237 20 6552K 720K run 0:04 78.36 17.33
perl
to
CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU
COMMAND
1 pts/0 21224 dilbert 227 20 21400K 15492K run 0:49 98.95 90.82
perl
and further.
This implies that the array @mlsfields is repeatedly being allocated
without being cleared. I would ideally expect Perl to overwrite the
existing array during each iteration of the loop.
Changing the line to :
my @mlsFields = split(/,/,$line);
solved the problem. The memory usage remains stable after making this
change.
Can someone explain this?
Also, by making the array my, do you think the array would be
overwritten? or would it be deallocated and reallocated for the new
iteration?
Thanks
------------------------------
Date: 14 Apr 2004 12:53:01 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: 'my' array variables avoid memory leaks?
Message-Id: <Xns94CB5A5F1357asu1cornelledu@132.236.56.8>
yashgt@yahoo.com (Yash) wrote in news:5a373b1d.0404140013.6122d782
@posting.google.com:
> Here is an unexpected behavior in Perl:
> #!/usr/bin/perl
use strict;
use warnings;
> $line=readline STDIN;
> while ($line ne "") {
> chomp $line; # remove newline from $line
> @mlsFields = split(/,/,$line);
> $line=readline STDIN;
> }
The code above is not correct:
readline EXPR
Reads from the filehandle whose typeglob is contained in EXPR.
In scalar context, each call reads and returns the next line,
until end-of-file is reached, whereupon the subsequent call
returns undef.
You never check for EOF in your code.
I tend not to care about the internals of how Perl deals with my variables.
It is better to scope your variables to the smallest appropriate scope and
tends to work fine. So, I would rewrite the routine above as
while(<STDIN>) {
chomp;
my @fields = split /,/;
# do something with @fields I presume
}
or, if you really want to use readline,
while( my $line = readline *STDIN) {
chomp $line;
my @fields = split /,/, $line;
# do something with @fields
}
If your memory problem goes away when you properly scope your variables, I
would be inclined to suspect that the code you showed us is not the real
code, and there are some other globals involved etc. not really care to
investigate further, but suggest that you use strict and warnings.
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: Wed, 14 Apr 2004 13:55:26 +0200
From: Matija Papec <perl@my-header.org>
Subject: Re: 3x3 simple puzzle
Message-Id: <pf9q70t6i23e01uinvfn9k7loi9bo35srm@4ax.com>
X-Ftn-To: budman
budman <budman@somewhere.net> wrote:
>> leftmost and rightmost column by 90 deg. ccw, or top and bottom row by
>> 90 deg. cw.
>>
>> If you only move them around you'll find only one solution (that's a
>> good start, I've used perldoc -q permute).
>
>Hmm.. I thought you wanted a solution finder... oh well. :)
>
>Thanks for the permute tip. I was working on a way to swap it, but thought
>of using pointers to the original tiles.
I think you could make optimization if you move cards instantly without
building all combinations first, something like,
permute(\&CheckTiles, 0 .. 8);
>I was able to get it to solve and find the 2 solutions in 20 seconds on a
>1.8Ghz.
>
>Grid: 3 x 3 Tiles: 9
>Possibilities found: 362880
>Solution 1: 3 0 5 8 2 7 1 4 6
>Solution 2: 3 0 4 8 2 7 1 5 6
That's it, only notice that 4th and 5th cards (that's 5th and 6th on my
picture) are identical so I guess these two can be considered as first
solution. There is one more but it requires some card rotation.
>Enjoyed the puzzle. :)
Yes, it's more fun to do it in perl rather then embarrassing yourself with
cards in front of young nephew. :-)
here is my solution,
http://globalnet.hr/~mpapec/perl/turtles.txt
--
Matija
------------------------------
Date: Wed, 14 Apr 2004 13:56:30 +0200
From: Matija Papec <perl@my-header.org>
Subject: Re: 3x3 simple puzzle
Message-Id: <el9q70djgq375bnf1ath9hg72v850bghtn@4ax.com>
X-Ftn-To: ctcgag@hotmail.com
ctcgag@hotmail.com wrote:
>> >Do you get to move tiles around, or only rotate them in place?
>>
>> Both. :)
>
>I found 16 solutions (I didn't canonicalize, so 4 "distinct" solutions,
>each one repeated in 4 major orientations). Two of them you can get just
>moving pieces without rotating them and two that require rotations.
I think you found the right ones, but there are two identical cards so
2 5 7 9 3 8 4 1 6
and
2 6 7 9 3 8 4 1 5
can count as one solution.
>It took 2 minutes on 1.13GHz pentium III. (30 seconds of that was
>generating permutations of 0..8 using my rather inefficient subroutine.)
>
>I had started righting a very complicated decision-tree process with
>rules for quick pruning, but I discovered that that was unnecessary because
>no piece has the same color/anatomy combo on it more than once. That made
>things much simpler.
Nice; I would like to see your code, mine is at
http://globalnet.hr/~mpapec/perl/turtles.txt
--
Matija
------------------------------
Date: 14 Apr 2004 15:38:59 GMT
From: ctcgag@hotmail.com
Subject: Re: 3x3 simple puzzle
Message-Id: <20040414113859.287$66@newsreader.com>
Matija Papec <perl@my-header.org> wrote:
> X-Ftn-To: ctcgag@hotmail.com
>
> ctcgag@hotmail.com wrote:
> >> >Do you get to move tiles around, or only rotate them in place?
> >>
> >> Both. :)
> >
> >I found 16 solutions (I didn't canonicalize, so 4 "distinct" solutions,
> >each one repeated in 4 major orientations). Two of them you can get
> >just moving pieces without rotating them and two that require rotations.
>
> I think you found the right ones, but there are two identical cards so
> 2 5 7 9 3 8 4 1 6
> and
> 2 6 7 9 3 8 4 1 5
> can count as one solution.
>
> >It took 2 minutes on 1.13GHz pentium III. (30 seconds of that was
> >generating permutations of 0..8 using my rather inefficient subroutine.)
> >
> >I had started righting a very complicated decision-tree process with
> >rules for quick pruning, but I discovered that that was unnecessary
> >because no piece has the same color/anatomy combo on it more than once.
> >That made things much simpler.
>
> Nice; I would like to see your code, mine is at
> http://globalnet.hr/~mpapec/perl/turtles.txt
Because each tile doesn't have the same color/anatomy combo more than once,
There is no branching. once one tile orientation is set, all the rest must
fall into place or be impossible. (The code would be a lot cleaner if I
didn't change horses midstream.)
my @turtle= ( [ qw/ yt bh gh rt/],
[ qw/ bt bh rh gt/],
[ qw/ gt bh yh rt/],
[ qw/ gt rh bh yt/],
[ qw/ yt rh gh bt/],
[ qw/ yt rh gh bt/],
[ qw/ yt rh gh rt/],
[ qw/ gt bh yh bt/],
[ qw/ bt rh bh gt/], );
foreach (1..@turtle) {
my $t=
{ num=>$_, # turtles ID
orient =>0, #starting orientation.
am => [@{$turtle[$_-1]}], # what I am (cw from top)
acc => [ map { s/t$/h/ or s/h$/t/ or die; $_}
@{$turtle[$_-1]}],
#what I can accept (cw from top)
done =>1, #not used in current implementation
};
$t->{hacc}{$_}++ foreach @{$t->{acc}};
# What I can accept, in hash format
die "Can't use this algorithm" if
grep $_>1, values %{$t->{hacc}};
$turtle[$_-1]=$t;
};
sub spin {
#print "Spinning:", Dumper $_[0];
## takes a turtle and a number, turns the turtle that many slots cw
$_[0]->{orient}+=$_[1];
unshift @{$_[0]->{am}}, pop @{$_[0]->{am}} foreach (1..$_[1]);
unshift @{$_[0]->{acc}}, pop @{$_[0]->{acc}} foreach (1..$_[1]);
};
sub solve_board {
my $b=shift;
#put the top-left tile in original orientation
spin $b->[0][0],1 while $b->[0][0]{orient}%4;
$b->[0][0]{orient}=0;
LOOP: while ($b->[0][0]{orient}<1) { #original was <4, but <1 results in
#canonicalized form.
## set the rest of the first row, if possible, by looking leftward [3]
## (Which means the one to the left of us is looking rightward [1])
foreach my $y(1..2) {
next LOOP unless $b->[0][$y]{hacc}{$b->[0][$y-1]{am}[1]};
spin $b->[0][$y],1 until $b->[0][$y]{acc}[3] eq $b->[0][$y-1]{am}[1]
};
## set the rest of the rows, if possible, by looking upward [0]
## and verify that that setting is compatible,
## by looking leftward [3]
foreach my $x(1..2) { foreach my $y(0..2) {
next LOOP unless $b->[$x][$y]{hacc}{$b->[$x-1][$y]{am}[2]};
spin $b->[$x][$y],1 until
$b->[$x][$y]{acc}[0] eq $b->[$x-1][$y]{am}[2];
next LOOP unless $y==0 or
$b->[$x][$y]{acc}[3] eq $b->[$x][$y-1]{am}[1];
}};
print "A solution is:\n";
print join ("\t",map {$_->{num}.":".$_->{orient}%4} @$_), "\n"
foreach @$b;
} continue{
spin($b->[0][0],1);
}
};
sub permute {
#takes arrayref, returns list of arrayrefs corresponding to each
permutation. my @i = @{ $_[0] };
return [] unless @i;
my @return;
foreach my $i (0..$#i) {
push @return, map { push @$_, $i[$i]; $_} permute(do{my $j=[@i];
splice @$j,$i,1; $j}); };
return @return;
};
foreach (permute([0..8])) {
my $b = [ [@turtle[@$_[6..8]]],
[@turtle[@$_[3..5]]],
[@turtle[@$_[0..2]]],
];
solve_board($b);
};
(Hopefully the line-wraps are better this time around.)
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 13 Apr 2004 16:57:28 GMT
From: Jaap Karssenberg <j.g.karssenberg@student.utwente.nl>
Subject: [ANNOUNCE] Zoidberg 0.51
Message-Id: <Hw64BI.BC6@zorch.sf-bay.org>
Zoidberg 0.51 is now available from a CPAN mirror near you !
Zoidberg (a.k.a. zoid) provides a modular Perl shell written,
configured, and operated entirely in Perl. It aspires to be a fully
operational login shell with all the features one normally expects.
But it also gives direct access to Perl objects and data structures
from the command line, and allows you to run Perl code within the
scope of your command line.
In this release many bugs in the Job control code were fixed, and it is
now stable again. The ReadLine code was forked into a separate module,
which features Term::ReadLine API compatibility. The installation now
uses Module::Build for better platform independence, and the complete
package was tested on various systems including Mac OS X, NetBSD, and
IRIX.
See http://zoidberg.sf.net for more information.
--
) ( Jaap Karssenberg || Pardus [Larus] | |0| |
: : http://pardus-larus.student.utwente.nl/~pardus | | |0|
) \ / ( |0|0|0|
",.*'*.," Proud owner of "Perl6 Essentials" 1st edition :) wannabe
------------------------------
Date: Tue, 13 Apr 2004 05:34:59 GMT
From: Ron Savage <ron@savage.net.au>
Subject: ANNOUNCE: CGI::Session::MembersArea V 1.11
Message-Id: <Hw64Bs.BCw@zorch.sf-bay.org>
The pure Perl module CGI::Session::MembersArea V 1.11
is available immediately from CPAN,
and from http://savage.net.au/Perl-modules.html.
On-line docs, and a *.ppd for ActivePerl are also
available from the latter site.
An extract from the docs:
1.11 Tue Apr 13 15:10:00 2004
- Fix a typo in method load_profile. A hash key had a double underscore prefix instead of a single underscore
--
Cheers
Ron Savage, ron@savage.net.au on 13/04/2004
http://savage.net.au/index.html
------------------------------
Date: Tue, 13 Apr 2004 05:00:12 GMT
From: Ron Savage <ron@savage.net.au>
Subject: ANNOUNCE: Javascript::MD5 V 1.02
Message-Id: <Hw64C5.qrp@zorch.sf-bay.org>
The pure Perl module Javascript::MD5 V 1.02
is available immediately from CPAN,
and from http://savage.net.au/Perl-modules.html.
On-line docs, and a *.ppd for ActivePerl are also
available from the latter site.
An extract from the docs:
1.02 Tue Apr 13 13:13:13 2004
- There are no code changes in this version
- Document the optional parameter to the 'javascript' method
- Add a section to the docs about CGI form submission, including calling the onClick event handler
--
Cheers
Ron Savage, ron@savage.net.au on 13/04/2004
http://savage.net.au/index.html
------------------------------
Date: Mon, 12 Apr 2004 22:43:35 GMT
From: Robert Rothenberg <perl_ann_skiplist_50.20.wlkngowl@spamgourmet.com>
Subject: ANNOUNCE: List::SkipList v0.51 - Perl implementation of skip lists
Message-Id: <Hw64CD.BDr@zorch.sf-bay.org>
List::SkipList v0.51 has been uploaded to PAUSE, and should show up on
a CPAN mirror near you. See
http://search.cpan.org/~rrwo/List-SkipList/
NAME
List::SkipList - Perl implementation of skip lists
REQUIREMENTS
Perl 5.6.1 is required.
The following non-standard modules are required:
enum
Carp::Assert is no longer required. However, the assertions can
be uncommented for debugging.
SYNOPSIS
my $list = new List::SkipList();
$list->insert( 'key1', 'value' );
$list->insert( 'key2', 'another value' );
$value = $list->find('key2');
$list->delete('key1');
DESCRIPTION
This is an implementation of skip lists in Perl. What are "skip
lists"?
Skip lists are a probabilistic data structure that seem likely
to supplant balanced trees as the implementation method of
choice for many applications. Skip list algorithms have the same
asymptotic expected time bounds as balanced trees and are
simpler, faster and use less space.(*)
This particular implementation may not necessarily be faster or
use less space, but in superficial testing, it does appear to be a
reasonably faster substitute for some tree modules. See the
included Benchmark.txt file for comparisons with other Perl
modules.
Skip lists are similar to linked lists, except that they have
random links at various levels that allow searches to skip over
sections of the list, like so:
4 +---------------------------> +----------------------> +
| | |
3 +------------> +------------> +-------> +-------> +--> +
| | | | | |
2 +-------> +--> +-------> +--> +--> +--> +-------> +--> +
| | | | | | | | |
1 +--> +--> +--> +--> +--> +--> +--> +--> +--> +--> +--> +
A B C D E F G H I J NIL
A search would start at the top level: if the link to the right
exceeds the target key, then it descends a level.
More information is available in the module documentation.
(*) Bill Pugh, inventor of skip lists. Quoted from WikiPedia
<http://en.wikipedia.org/wiki/Skip_list>
REVISION HISTORY
Changes since v0.50:
0.51 Mon Apr 12 2004
- fixed bug with next_key method called without first_key
- added tests for this bug
- added "heavy" test to distribution
- minor optimizations of delete method
- assertions are no longer required (which leads to ~3% speedup)
and removed section in POD about assertions
- removed commented-out references to forward method
- minor updates to source code comments
A detailed revision history is in the Changes file included with
this distribution.
CAVEATS
Skip lists are non-deterministic. Because of this, bugs in programs
that use this module may be subtle and difficult to reproduce without
many repeated attempts.
AUTHOR
Robert Rothenberg <rrwo at cpan.org>
LICENSE
Copyright (c) 2003-2004 Robert Rothenberg. All rights reserved. This
program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
------------------------------
Date: Wed, 14 Apr 2004 06:45:54 -0600
From: Bill <wherrera@lynxview.com>
Subject: Re: Can you use the "fork" function in Windows?
Message-Id: <-P6dnRhGDpAbr-DdRVn-gw@adelphia.com>
nub5 wrote:
> Hello all I'm trying to use the fork function for Windows 2000 Prof,
> Perl version 5.005_002.
I think fork is generally broken in many Windows Perl versions under
5.6, try updating if you can.
hth
------------------------------
Date: 14 Apr 2004 13:40:10 GMT
From: Roel van der Steen <roel-perl@st2x.net>
Subject: Re: Can you use the "fork" function in Windows?
Message-Id: <slrnc7qfh2.50s.roel-perl@195-86-124-242.dsl.easynet.nl>
On Mon, 12 Apr 2004 at 20:58 GMT, nub5 <rmiller_nub@yahoo.com> wrote:
> Hello all I'm trying to use the fork function for Windows 2000 Prof,
> Perl version 5.005_002.
Except for a typo and not using strict and warnings, your code is OK.
You should upgrade to a newer version of Perl where the fork function
is implemented. See
http://aspn.activestate.com/ASPN/docs/ActivePerl/lib/Pod/perlfork.html
------------------------------
Date: Wed, 14 Apr 2004 20:28:08 +1200
From: "Tintin" <me@privacy.net>
Subject: Re: CGI Perl on IIS
Message-Id: <c5isle$24o8r$1@ID-172104.news.uni-berlin.de>
"dave h" <daveharney@wi.rr.com> wrote in message
news:qi2fc.92227$4B1.38911@twister.rdc-kc.rr.com...
> Hi,
>
> I have this page called index.shtml ----
OK
> ---------------------------------------
> and this perl script call perltest.pl --
> #!c:\perl\bin
> print "Content-type: text/html\n\n";
> print "xxx\n";
> #exit;
No Perl errors here.
> --------------------------------------------------------
> when I run the index.shtml page the perl script returns a long string of
> header info in front of the "xxx" that I was looking for. The W2K IIS
host
> I running on recommends using <meta name="hideHeader" content=""> before
the
> <!--#exec cgi="/perltest/perltest.pl" --> statement to eliminate these
> unwanted headers. I've not been successful in getting rid of the headers
> with this approach..
>
> Any suggestions for getting rid of the unwanted headers - the actual line
> returned looks like -> "HTTP/1.1 200 OK Date: Wed, 14 Apr 2004 00:09:47
GMT
> Server: Microsoft-IIS/5.0 Content-type: text/html xxx "
No Perl content here, but I'll give you a freebie. NPH.
------------------------------
Date: 14 Apr 2004 15:47:39 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Changing from C thought to Perl
Message-Id: <c5jmer$s5e$1@mamenchi.zrz.TU-Berlin.DE>
Rob Perkins <rob_perkins@hotmail.com> wrote in comp.lang.perl.misc:
> Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
[snip]
> Side effects? I've already run into one: regex's don't behave the same
> on every platform.
That sentence makes me doubt you know what you are talking about. What
has the different behavior of regular expressions in different languages
to do with side effects?
Anno
------------------------------
Date: Wed, 14 Apr 2004 12:13:24 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Changing from C thought to Perl
Message-Id: <Pine.A41.4.58.0404141210020.14108@ginger.libs.uga.edu>
On Wed, 14 Apr 2004, Rob Perkins wrote:
> Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
>
> >Global variables are not a bad thing per se. Side effects are not a bad
> >thing per se.
>
[...]
> No, not a bad thing, per se. Unless you need/want to share your code.
There's lots of shared code that use global variables. I didn't say you
couldn't do it wrong. :-)
Regards,
Brad
------------------------------
Date: Wed, 14 Apr 2004 12:47:42 -0400
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Changing from C thought to Perl
Message-Id: <pan.2004.04.14.16.47.37.168231@remove.adelphia.net>
On Wed, 14 Apr 2004 02:13:10 +0000, Rob Perkins wrote:
> Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
[ ... ]
> Side effects? I've already run into one: regex's don't behave the same
> on every platform. Side effects aren't a bad thing per se. Unless you
> want cross platform capability. Then you're screwed.
And *where* did you read this? I've *never* had an issue with regular
expressions across platforms.
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
It is impossible to experience one's death objectively and still
carry a tune. -- Woody Allen
------------------------------
Date: Wed, 14 Apr 2004 16:50:02 GMT
From: Ala Qumsieh <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: Changing from C thought to Perl
Message-Id: <_Ydfc.22513$9H1.5335@newssvr27.news.prodigy.com>
Rob Perkins wrote:
> Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
>
>
>>Global variables are not a bad thing per se. Side effects are not a bad
>>thing per se.
> No, not a bad thing, per se. Unless you need/want to share your code.
I agree with most of what you say, but sometimes you can't help it.
There are programs that are very difficult to write without global vars,
like GUIs for example. Here, a program sits waiting for the user to do
something, and has to react accordingly. It is extremely difficult to
bypass using global vars, and in fact global vars make the program much
simpler and easier to maintain.
> Side effects? I've already run into one: regex's don't behave the same
> on every platform.
Care to give an example where a Perl regexp works differently on two
different platforms, assuming of course you are using the same Perl version.
--Ala
------------------------------
Date: Wed, 14 Apr 2004 11:12:48 -0400
From: Michael Friendly <friendly@yorku.ca>
Subject: debian: how to install/maintain perl packages?
Message-Id: <c5jke8$lth$1@sunburst.ccs.yorku.ca>
I'm confused about how to install perl packages on a debian system, to
allow easy maintenance and upgrades.
Many perl packages exist as debian distros, and so can be installed
(as root) into the standard system perl library tree, and easily
upgraded using apt-get or aptitude. (However, from aptitude, it is
difficult to see which perl modules they contain.)
Using the cpan script or shell, it is not clear whether I should install
packages as root or as a normal user, and, if as user, where these
should go. Same question, if I download packages directly from CPAN.
Can someone provide suggestions?
My perl @INC list (below) shows several libraries under /usr/local/,
some of which are owned by root and some by me.
% perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
Platform:
osname=linux, osvers=2.4.22-xfs+ti1211,
archname=i386-linux-thread-multi
uname='linux kosh 2.4.22-xfs+ti1211 #1 sat oct 25 10:11:37 est 2003
i686 gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN
-Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr
-Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5
-Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local
-Dsitelib=/usr/local/share/perl/5.8.3
-Dsitearch=/usr/local/lib/perl/5.8.3 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm
-Duseshrplib -Dlibperl=libperl.so.5.8.3 -Dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
...
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at Jan 29 2004 15:23:28
@INC:
/etc/perl
/usr/local/lib/perl/5.8.3
/usr/local/share/perl/5.8.3
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8
/usr/share/perl/5.8
/usr/local/lib/site_perl
/usr/local/lib/perl/5.8.0
/usr/local/share/perl/5.8.0
.
--
Michael Friendly Email: friendly@yorku.ca
Professor, Psychology Dept.
York University Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT M3J 1P3 CANADA
------------------------------
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 V10 Issue 6400
***************************************