[19615] in Perl-Users-Digest
Perl-Users Digest, Issue: 1810 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 25 06:05:31 2001
Date: Tue, 25 Sep 2001 03:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1001412308-v10-i1810@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 25 Sep 2001 Volume: 10 Number: 1810
Today's topics:
Re: a bit of help please. (Chris Fedde)
Re: alternatives to ps command (perl misk)
Re: Creating a file (Martien Verbruggen)
Re: Creating modules <ron@savage.net.au>
Dump raw data <philippe.perrin@sxb.bsf.alcatel.fr>
Re: Dump raw data <peb@bms.umist.ac.uk>
Re: emailing contents of text file <rob_13@excite.com>
Re: emailing contents of text file (jcole)
Re: emailing contents of text file (jcole)
Expect for Perl (Prakash)
Re: Expect for Perl (Logan Shaw)
Re: faster execution (venus)
Re: Help: mail script (WIN) <bwalton@rochester.rr.com>
Re: how to match things like this <please@no.spam>
Re: how to replace several blank lines with 1 (Ian Boreham)
Re: module for generating Excel spreadsheet? (John McNamara)
Re: Net::DNS doesn't work when trying to query a namese (Chris Fedde)
Perl ROOT <glodalec@yahoo.com>
Re: Perl ROOT <ravn@thunderbear.dyndns.dk>
Re: Perl ROOT <glodalec@yahoo.com>
Re: Perl ROOT (Martien Verbruggen)
Re: Slicing emptiness (Anno Siegel)
Re: The joys of segmentation faults <please@no.spam>
Re: threads <mb@hgs.at>
Re: who said this? <Dave.Stafford@globis.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 25 Sep 2001 04:25:23 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: a bit of help please.
Message-Id: <TGTr7.655$Owe.322884096@news.frii.net>
In article <1f08wcz.rffvu6a2wl2hN%planb@newsreaders.com>,
J.B. Moreno <planb@newsreaders.com> wrote:
>
>Perl generally isn't considered the ideal first language, which I assume
>this is for you, otherwise it'd have been fairly obvious what you would
>need to do to make it count by 10.
>
There is at least one text that uses perl as an introduction to
programming language: "Elements of Programming with Perl", by
Johnson, published by Manning, (ISBN 1-884777-80-5).
Good Luck
--
This space intentionally left blank
------------------------------
Date: 25 Sep 2001 01:57:25 -0700
From: perlmisk@yahoo.co.uk (perl misk)
Subject: Re: alternatives to ps command
Message-Id: <7fe42fcd.0109250057.2fda2529@posting.google.com>
> For example, the following command works on Solaris, AIX and linux
> and presensts an (almost) identically formatted result:
>
> ps -u ilja -o pid= -o user= -o vsz= -o etime= -o time= -o args=
>
> Hope this helps.
> Ilja.
Yes, brilliant! I had seen -o in man ps but it referred me to "DISPLAY
FORMATS" and I didn't know where this was.
I had looked at ProcessTable but the version was <1.0 and when I ran
"perl Makefile.PL" I had a warning so I was scared off running it in a
production system.
Regards
Andy
------------------------------
Date: Tue, 25 Sep 2001 19:05:12 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Creating a file
Message-Id: <slrn9r0i68.8ai.mgjv@martien.heliotrope.home>
On Mon, 24 Sep 2001 13:49:23 -0500 (CDT),
BUCK NAKED1 <dennis100@webtv.net> wrote:
> I don't recommend using >> when opening a file. It always clobbers files
> when I use it, and often creates garbage files.
That means that your Perl is broken, or your system libraries are
broken, or you're doing something else you're not telling us about. >>
does _not_ clobber files, and it doesn't magically create garbage to put
in those files either.
Please create a perl bug report that includes example code, and the full
output of perl -V.
> I like to use sysopen. See perldoc -f sysopen. Of course, you'll need to
> call out the Fnctl module to use it; but it comes with the regular
> distribution I believe.
Yes, it does. But it isn't the solution to your problem. Your problem is
that you have a broken Perl, system or broken code. If append mode for
open() was broken in Perl, it would be known far and wide, and it would
have been fixed a long time ago.
Martien
--
Martien Verbruggen |
Interactive Media Division | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd. | selective about its friends.
NSW, Australia |
------------------------------
Date: Tue, 25 Sep 2001 18:27:45 +1000
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Creating modules
Message-Id: <ehXr7.866$bL3.63702@ozemail.com.au>
GunneR
Here's a useful answer, for a change.
One place is to examine tutorial # 1 http://savage.net.au/Perl-tuts-1-30.html
--
Cheers
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html
GunneR <ds@ss.com> wrote in message news:spc2rtcsn5t2tqfcref6cn7f58k54jm8s9@4ax.com...
> Im having trouble creating a simple module (just to get started). I've
> had a bit of trouble finding good documentation on creating modules.
> Anyone know any informative sites? I've found McDougalls documentation
> but im looking for some further reading.
>
> Thanks!
------------------------------
Date: Tue, 25 Sep 2001 09:31:19 +0200
From: Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr>
Subject: Dump raw data
Message-Id: <3BB032C7.D149A04C@sxb.bsf.alcatel.fr>
Hi
I need to regularly dump a whole hash on disk, and reload it later. Is
there a way to write its "raw data" on a file descriptor (I mean the way
Perl stores it in memory) ? I'm looking for a pair of functions which
would work that way :
# save %table to disk
open(S, "> saveFile");
binmode S;
saveData(*S, \%table); # this function
close(S);
# load %table from disk
open(S, "saveFile");
binmode S;
loadData(*S, \%table); # and that one
close(S);
I'm looking for this kind of functions to save/restore hashes fastly and
efficiently (less wasted space than ASCII files).
Any help ? Of course, I don't care if these functions are
platform-dependent.
--
PhP
($r1,$r2,$r3,$r4)=("19|20","0|1","28|29","5|24");($r5,$r6)=("9|10|15|16|$r1|$r2","9|10|$r3");%h=("1|",$r6,"1=","[1-5]|2[0-4]","1/","0|19","1\\","6|25","2|","0|6|19|25|$r6","2/","1|20","2\\",$r4,"3|","$r2|6|$r1|25|$r6","3/",$r4,"4|","$r2|$r1|$r6","4=","2|3|4|11|12|13|14|21|22|23","4/",$r4,"4\\",15,"5|","$r2|9|15|$r1|20|$r3","5/",10,"6|",$r5,"7|",$r5,"7/",$r3);for($l=1;$l<8;$l++){b:for($i=0;$i<30;$i++){c:foreach(keys
%h){next c if(!(/^$l(.*)$/));$a=$1;if($i=~/^($h{$_})$/){print $a;next
b;}}print " ";}print "\n";}
------------------------------
Date: Tue, 25 Sep 2001 10:15:15 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Dump raw data
Message-Id: <3BB04B23.C8883C3E@bms.umist.ac.uk>
Philippe PERRIN wrote:
> I need to regularly dump a whole hash on disk, and reload it later. Is
> there a way to write its "raw data" on a file descriptor (I mean the way
> Perl stores it in memory) ? I'm looking for a pair of functions which
> would work that way :
A couple of methods spring to mind.
have a look at the perltie documentation ('perldoc perltie' on the
command line) and/or look at the Data::Dumper module.
HTH
Paul
------------------------------
Date: Tue, 25 Sep 2001 05:02:04 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: emailing contents of text file
Message-Id: <Xns9127A76C5C50rock13com@64.8.1.226>
jcole <news:3baffd06.60522038@nntp.ix.netcom.com>:
> while(<EMAILADDRESSFILE>)
> {
> open MAIL, "|mail " . $_;
> print MAIL $heading . $quote;
> close MAIL;
> }
>
> I want $heading . $quote; to be changed to the contents of a
> text file. In other words, I want to have a text file sitting
> in the directory this script is in, and have that text file
> contain the body
> of my mass email, so I would be able to write something like
So open the file and print the contents in the body of the message.
This is a rather basic thing to do and reading some documentation
that comes with Perl should soon allow you to figure it out.
Sounds like spam to me.
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Tue, 25 Sep 2001 05:19:42 GMT
From: quikscor@ix.netcom.com (jcole)
Subject: Re: emailing contents of text file
Message-Id: <3bb013ab.66319894@nntp.ix.netcom.com>
for sendmail I'm getting
command not found
>On Tue, 25 Sep 2001 03:44:26 GMT, quikscor@ix.netcom.com (jcole)
>wrote:
>
>>while(<EMAILADDRESSFILE>)
>>{
>> open MAIL, "|mail " . $_;
>> print MAIL $heading . $quote;
>> close MAIL;
>>}
>>
>>I want $heading . $quote; to be changed to the contents of a text
>>file. In other words, I want to have a text file sitting in the
>>directory this script is in, and have that text file contain the body
>> of my mass email, so I would be able to write something like
>>
>>while(<EMAILADDRESSFILE>)
>>{
>> open MAIL, "|mail " . $_;
>> print MAIL [a filename];
>> close MAIL;
>>}
>>
>>Help! I need a solution quick.
>You could use something like:
>
> if($SENDMAIL ne "") {
> open (MAIL,"|-") || exec($SENDMAIL, "-t", "-oi");
> print MAIL "To: $email
>From: $daemonEmail
>Subject: Re: $header
>";
> print MAIL $msg;
> print MAIL "\n";
> close MAIL;
>
>You can also have a file ($file) in which there are lines of type
>From: George Schmertz <schmertz@schmertz.com>
>etc
>
>Message, etc
>
>and then use something like:
>system("sendmail -t $recipient<$file");
>
>The -t option caises sendmail to read headers from $file.
>
------------------------------
Date: Tue, 25 Sep 2001 05:25:19 GMT
From: quikscor@ix.netcom.com (jcole)
Subject: Re: emailing contents of text file
Message-Id: <3bb0150e.66674570@nntp.ix.netcom.com>
On Tue, 25 Sep 2001 05:02:04 GMT, "Rob - Rock13.com"
<rob_13@excite.com> wrote:
>So open the file and print the contents in the body of the message.
>
>This is a rather basic thing to do and reading some documentation
>that comes with Perl should soon allow you to figure it out.
>
>Sounds like spam to me.
>
LOL --- what a kidder.
------------------------------
Date: Tue, 25 Sep 2001 02:47:24 -0400
From: "Mishra, Prakash Kumar (Prakash)" <prakashm@lucent.com>
Subject: Expect for Perl
Message-Id: <19827936E75CD411800D00508B1293D004E67E64@LTOPSEXCH001H>
I am developping a tool for testing. I want to use expect scripts with
Perl. Is there any way do that.
I want to get some values from a telnet session and assign that value to
ona variable.
------------------------------
Date: 25 Sep 2001 02:28:25 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Expect for Perl
Message-Id: <9opbmp$5lg$1@charity.cs.utexas.edu>
In article <19827936E75CD411800D00508B1293D004E67E64@LTOPSEXCH001H>,
Mishra, Prakash Kumar (Prakash) <prakashm@lucent.com> wrote:
>I am developping a tool for testing. I want to use expect scripts with
>Perl. Is there any way do that.
You could call an external expect script.
Or you could use the Perl module called Expect, which isn't expect, but
which does pretty much the same thing.
See http://search.cpan.org/search?dist=Expect .
>I want to get some values from a telnet session and assign that value to
>ona variable.
In that case, I would ignore the Expect concept entirely and instead
just use Net::Telnet to do what you want directly.
See http://search.cpan.org/search?mode=module&query=Net%3A%3ATelnet .
- Logan
--
"Everybody
Loves to see
Justice done
On somebody else" ( Bruce Cockburn, "Justice", 1981 )
------------------------------
Date: 25 Sep 2001 01:53:07 -0700
From: train2venus@hotmail.com (venus)
Subject: Re: faster execution
Message-Id: <bce84cea.0109250053.4c2e7ac9@posting.google.com>
Hi...
What if I have an array that has different keys pointing to the same
value?
%LOCATION = (
"GBE", 'Gaborone,,BC',
"GBC", 'Gaborone,,BC',
"ADL", 'Amman,,JD', );
instead of :
%LOCATION = (
'Gaborone,,BC', "GBE",
'Amman,,JD', "ADL", );
I tried this:
%LOCATIONS = reverse %LOCATION;
while (<INPUT_FILE>) {
($city, $statecode, $countrycode, $date1, $max1, $min1,
$cond1, $date2, $max2, $min2, $cond2,
$date3, $max3, $min3, $cond3, $date4, $max4, $min4, $cond4,
$date5, $max5, $min5, $cond5, $date6, $max6, $min6, $cond6 )
= split (/,/);
$location = "$city,$statecode,$countrycode";
if( exists $LOCATIONS{$location} ){
print OUTPUT_FILE "$LOCATIONS{$location},$max1,$min1,$cond1\n";
but this will eliminate those repeated values and only prints one of
the associated key. Any other way to do it?
Appreciate if you could help.
regards,
venus
------------------------------
Date: Tue, 25 Sep 2001 04:10:07 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Help: mail script (WIN)
Message-Id: <3BB002BC.80F6B3D4@rochester.rr.com>
bill wrote:
>
> In <9olr6j$j34$1@charity.cs.utexas.edu> logan@cs.utexas.edu (Logan Shaw) writes:
>
> >A fairly obvious way is to connect to some SMTP server somewhere
> >and spit the mail message at it. You can do this with Net::SMTP.
>
> The mail must come from the "usual" SMTP server (i.e. the one used by
> the usual mail program when mail is sent from the machine in
> question). The problem is, I can't figure out what this server's
> name/domain is. Is there a program that will reveal that information?
...
> bill
Well, when it comes to SMTP servers, there really isn't a "usual" SMTP
server associated with a given machine. The SMTP server I usually use,
for example, resides somewhere on RoadRunner's computer farm. But I
could just as easily send through FrontierNet's SMTP server (where I
still have an account they forgot to close out years ago). When you go
to send mail using SMTP, the address of the SMTP server is your starting
point -- without that, you are going nowhere.
You don't give any information about the computer or the programs on it
which send mail. If it is, for example, a PC and someone is sending
mail using, for example, Netscape Communicator, you can look in that
person's Netscape user settings to see what they specified as their
outgoing mail server.
--
Bob Walton
------------------------------
Date: Tue, 25 Sep 2001 09:43:22 GMT
From: Andrew Cady <please@no.spam>
Subject: Re: how to match things like this
Message-Id: <87ofnz7glh.fsf@homer.cghm>
Rainer Klier <Rainer.Klier@erl.sbs.de> writes:
> Andrew Cady wrote:
>
> > crud@hongkong.com (Dav Lam) writes:
> >
> > > i wondering how to match a string that not include another
> > > substring, because it's not a char class but a string, i can't
> > > use something like [^], but what can i do?hope there is somebody
> > > help me out of this.
> >
> > One way:
> > /(?!another substring).*/
>
> Another way: index($string,$substring) == -1 Should be much faster
> than regex.
Erm, yeah, I thought he was asking for multi-character equivalent of a
character class, for use as part of a larger regex... If all he wants
is to verify that the substring isn't in the string, my regex wouldn't
even work. I should have read his post more carefully. (Actually,
looking at it now, his question is ambiguous. "Match" could easily
mean within the context of a larger regex. But I guess he probably
didn't mean that).
------------------------------
Date: 24 Sep 2001 21:18:30 -0700
From: ianb@ot.com.au (Ian Boreham)
Subject: Re: how to replace several blank lines with 1
Message-Id: <f02c4576.0109242018.17b60a63@posting.google.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3BAE3248.C93D7066@earthlink.net>...
> > > perl -ni.bak -e 'print if !/^$/' file1 file2 ...
> >
> > That removes *all* blank lines. Admittedly, he could have
> > been more clear, but I *think* what he wanted was to remove
> > only multiple adjascent blank lines, leaving one...
> [snip]
>
> perl -lp00i.bak -e1 file1 file2 ...
>
> NB this is untested.
This also removes all blank lines. The switches appear to be processed
as follows:
l: chomp $/ (modified later to effectively /\n+/) and set $\ to the
current value of $/ ("\n")
00: set $/ to "paragraph mode" (effectively /\n+/)
---
I think you want:
perl -p00li.bak -e1 file1 file2 ...
00: set $/ to "paragraph mode" (effectively /\n+/)
l: chomp $/ (/\n+/) and set $\ to $/ (/\n+/, apparently treated as
"\n\n" for output).
...which seems to work. I can't find a mention of this special
behaviour for the combination of 00 and l, and I can't replicate it by
trying to set $\ explicitly. And since -l appears to take only a
single octal value, multi-character line endings can't be set this
way, except, apparently, using the above magic.
---
Alternatively, let the -e actually set $\ explicitly.
Regards,
Ian
------------------------------
Date: Tue, 25 Sep 2001 08:27:00 GMT
From: jmcnamara@cpan.org (John McNamara)
Subject: Re: module for generating Excel spreadsheet?
Message-Id: <3bb03ec2.426183@News.CIS.DFN.DE>
Ar Mon, 24 Sep 2001 17:46:06 -0500, do schriobh Bing Du:
>I was told there is a Perl module which can generate file in Microsoft
>Excel spreadsheet format. Can anybody give me some clue about the name
>of this module, so I can move ahead looking at it further?
Spreadsheet::WriteExcel is a cross-platform module for creating new
Excel files:
http://search.cpan.org/search?dist=Spreadsheet-WriteExcel
Alternative Perl modules and methodologies are listed in the
documentation:
http://search.cpan.org/doc/JMCNAMARA/Spreadsheet-WriteExcel-0.33/WriteExcel/doc/WriteExcel.html#WRITING_EXCEL_FILES
John.
--
# Sum the numbers in the first column of a file
perl -lpe '$,+=$_}{$_=+$,' file
------------------------------
Date: Tue, 25 Sep 2001 04:39:09 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Net::DNS doesn't work when trying to query a nameserver by domain and not by IP-address
Message-Id: <NTTr7.656$Owe.299650048@news.frii.net>
In article <3BAF4BB7.7090705@bNamed.be>,
Bart Mortelmans <Usenet@bNamed.be> wrote:
>Michael Fuhr wrote:
>
>> Bart Mortelmans <Usenet@bNamed.be> writes:
>>
>>> [helpfull information about how to debug this problem]
>
>
>To make it more clear: the nameserver is
>ns1.oxygendns.net. The SOA for oxygendns.net is ns1.oxygendns.net and
>when I ask ns1.oxygendns.net for the A-record of ns1.oxygendns.net, it
>returns "Non-existent domain".
>
The problem is a configuraton error in the oxygendns.net zone
itself. Your discussuion supposes that the name servers for the
zone are configured correctly. As it turns out they are not. The
GTLD-SERVERS.net nameservers have "glue" A records for the zone
but the name servers themselves do not have matching A records.
A better discussion of these issues might be found in a news group
that has bind or DNS in its name.
Good Luck
--
This space intentionally left blank
------------------------------
Date: Tue, 25 Sep 2001 09:09:02 +0200
From: Marvin <glodalec@yahoo.com>
Subject: Perl ROOT
Message-Id: <MPG.161a4bf73c5a59a0989706@news.siol.net>
Hi !
I installed perl on exported FS under /tools/usr/local/....
Every client has mounted that directory.
Now when Im trying to run a perl script, it looks in /usr/local/....
structure for libraries. Is there any way I can change perl root
directory to be /tools.
I also tried with
use lib "/tools/usr/local/lib/perl5/..." ;
use lib "/tools/usr/local/lib/perl5/..." ;
use lib "/tools/usr/local/lib/perl5/..." ;
but it doesnt work.
Please suggest.
------------------------------
Date: 25 Sep 2001 15:13:39 +0200
From: Thorbjoern Ravn Andersen <ravn@thunderbear.dyndns.dk>
Subject: Re: Perl ROOT
Message-Id: <m2vgi7fm64.fsf@thunderbear.dyndns.dk>
Marvin <glodalec@yahoo.com> writes:
> Hi !
>
> I installed perl on exported FS under /tools/usr/local/....
>
> Every client has mounted that directory.
> Now when Im trying to run a perl script, it looks in /usr/local/....
> structure for libraries. Is there any way I can change perl root
> directory to be /tools.
> I also tried with
> use lib "/tools/usr/local/lib/perl5/..." ;
> use lib "/tools/usr/local/lib/perl5/..." ;
> use lib "/tools/usr/local/lib/perl5/..." ;
>
> but it doesnt work.
You might find the easiest solution is to recompile perl from scratch
and tell it that it will be placed in the above location.
--
Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: Tue, 25 Sep 2001 09:50:19 +0200
From: Marvin <glodalec@yahoo.com>
Subject: Re: Perl ROOT
Message-Id: <MPG.161a55aa15eefeed989707@news.siol.net>
In article <m2vgi7fm64.fsf@thunderbear.dyndns.dk>,
ravn@thunderbear.dyndns.dk says...
> Marvin <glodalec@yahoo.com> writes:
>
> > Hi !
> >
> > I installed perl on exported FS under /tools/usr/local/....
> >
> > Every client has mounted that directory.
> > Now when Im trying to run a perl script, it looks in /usr/local/....
> > structure for libraries. Is there any way I can change perl root
> > directory to be /tools.
> > I also tried with
> > use lib "/tools/usr/local/lib/perl5/..." ;
> > use lib "/tools/usr/local/lib/perl5/..." ;
> > use lib "/tools/usr/local/lib/perl5/..." ;
> >
> > but it doesnt work.
>
> You might find the easiest solution is to recompile perl from scratch
> and tell it that it will be placed in the above location.
>
>
Although several people would tell the best idea is to recompile, I have
a binary version and want to find out the solution (if possible) within
the version already compiled.
------------------------------
Date: Tue, 25 Sep 2001 19:26:45 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Perl ROOT
Message-Id: <slrn9r0jek.8ai.mgjv@martien.heliotrope.home>
On Tue, 25 Sep 2001 09:50:19 +0200,
Marvin <glodalec@yahoo.com> wrote:
> In article <m2vgi7fm64.fsf@thunderbear.dyndns.dk>,
> ravn@thunderbear.dyndns.dk says...
>> Marvin <glodalec@yahoo.com> writes:
>>
>> > Hi !
>> >
>> > I installed perl on exported FS under /tools/usr/local/....
>> >
>> > Every client has mounted that directory.
>> > Now when Im trying to run a perl script, it looks in /usr/local/....
>> > structure for libraries. Is there any way I can change perl root
>> > directory to be /tools.
>> > I also tried with
>> > use lib "/tools/usr/local/lib/perl5/..." ;
>> > use lib "/tools/usr/local/lib/perl5/..." ;
>> > use lib "/tools/usr/local/lib/perl5/..." ;
>> >
>> > but it doesnt work.
>>
>> You might find the easiest solution is to recompile perl from scratch
>> and tell it that it will be placed in the above location.
>>
>>
> Although several people would tell the best idea is to recompile, I have
> a binary version and want to find out the solution (if possible) within
> the version already compiled.
I can't think of an easy solution. These paths are hardcoded in the perl
binary:
$ strings /opt/perl/bin/perl | grep /opt/
/opt/perl/bin
/opt/perl/lib/5.6.1
/opt/perl/lib/5.6.1/i686-linux
/opt/perl/lib/site_perl/5.6.1/i686-linux
/opt/perl/lib/site_perl/5.6.1
/opt/perl/lib/site_perl
You could manipulate the PERL5LIB environment variable, and replace the
perl binaries with shell scripts that set it. Maybe you can fiddle with
the Config.pm module, although I am not sure whether Perl actually reads
that and uses that when starting. I actually doubt it. And another
alternative is to make sure a use lib is always used. That should work.
Have you read the documentaiton on it?
But I would either recompile Perl so that it knows about that path, or
symlink /usr/local/lib/perl5 to /tools/usr/local/lib/perl5.
Martien
--
Martien Verbruggen |
Interactive Media Division | Can't say that it is, 'cause it
Commercial Dynamics Pty. Ltd. | ain't.
NSW, Australia |
------------------------------
Date: 25 Sep 2001 08:45:32 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Slicing emptiness
Message-Id: <9opg7c$j0g$1@mamenchi.zrz.TU-Berlin.DE>
According to Rafael Garcia-Suarez <rgarciasuarez@free.fr>:
> Anno Siegel wrote in comp.lang.perl.misc:
> } Slicing an empry array, as in
> }
> } # a)
> } my @x;
> } my @y = @x[ 1, 2, 3];
> } print scalar @y, "\n";
> }
> } yields a list of so many undef's (it prints 3).
>
> From perldata:
>
> A slice of an empty list is still an empty list. Thus:
>
> @a = ()[1,0]; # @a has no elements
> @b = (@a)[0,1]; # @b has no elements
> @c = (0,1)[2,3]; # @c has no elements
>
> Note the parentheses around @a on the 2d line.
> In your example, @x gets modified (autovivification of elements).
I don't see autovivification happening here; at least it leaves no
traces on @x.
> } Doing the same with an
> } empty list
> }
> } # b)
> } @y = ()[ 1, 2, 3];
> } print scalar @y, "\n";
> }
> } leaves @y empty (prints 0).
> }
> } When the list contains at least one element, the behavior changes
> }
> } # c)
> } @y = ( 'wawa')[ 1, 2, 3];
> } print scalar @y, "\n";
> }
> } prints 3 again.
> }
> } I think the behavior in b) is a bug.
>
> According to the docs, b) is correct and the behavior you get for c) is
> a bug. I can't reproduce it.
Nor can I, with the indexes (1, 2, 3) I posted. However, as Tina also
noted,
# c.1)
@y = ( 'wawa')[ 0, 1, 2];
print scalar @y, "\n";
does print 3.
What I do find now (and should have found before posting) is that all
this quirkiness is perfectly documented in perldata. Sorry for making
a fuss.
Anno
------------------------------
Date: Tue, 25 Sep 2001 04:42:20 GMT
From: Andrew Cady <please@no.spam>
Subject: Re: The joys of segmentation faults
Message-Id: <874rpr993n.fsf@homer.cghm>
Ilya Martynov <ilya@martynov.org> writes:
> 4) You OS is configured to limit available memory for processes. In
> this case if Perl tries to allocate memory and can't get it Perl
> dies with segfault.
No, this should not happen. Segfaults are caused by trying to ACCESS
unallocated memory. If perl tries unsuccessfully to allocate memory,
it should get an error from sbrk, or malloc, or whatever it uses, and
it should handle that error gracefully. Anything else is a bug.
------------------------------
Date: 25 Sep 2001 09:17:42 +0200
From: Buchleitner Martin <mb@hgs.at>
Subject: Re: threads
Message-Id: <3bb02f96$1@netnews.web.de>
mgjv@tradingpost.com.au (Martien Verbruggen) wrote:
>On Mon, 24 Sep 2001 22:18:27 +0200,
*snipped*
>If you post a bit more about how exactly this client is supposed to
>work, and what is going in and out, maybe we can guide you a bit more
>towards the solution that is most likely to work well...
At the moment i have 3 main subs
- login
- reading data
- sending data
first i have to call login to get a servercookie.
then i call the reading-sub at the moment.
my problem is that, i am not able to interrupt the
reading sub. when i would do this, the server would
delete the cookie and i would have to login again.
the reading-sub is like a web-bot. it is reading data
from an html-document, parses it and displays the output.
at the same time the user should also be able to send messages
to the server. this sub is already able to do this,
it send data to the server in a http-header.
this client will have a gtk+ interface to display the html
content, which is read from the server.
my problem is, that i am not able to handle user-inputs.
martin
--
__________________________________________________________
News suchen, lesen, schreiben mit http://newsgroups.web.de
------------------------------
Date: Tue, 25 Sep 2001 09:07:22 GMT
From: "Dave Stafford" <Dave.Stafford@globis.net>
Subject: Re: who said this?
Message-Id: <ePXr7.14890$DJ3.1023533@nlnews00.chello.com>
> I remember a saying like:
>
> In the windoze world, I am limited by the tools that I can use, In
> Unix, I am limited by my own wisdom.
>
> I want to know who said it (I know he is very famous), and I want to
> know the original quote. Thanks
Bill Gates I think.
------------------------------
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.
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 1810
***************************************