[9473] in Perl-Users-Digest
Perl-Users Digest, Issue: 3068 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 6 21:07:23 1998
Date: Mon, 6 Jul 98 18:02:47 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 6 Jul 1998 Volume: 8 Number: 3068
Today's topics:
CGI.pm Package & redirect sonigopi@hotmail.com
Re: CGI.pm Package & redirect (brian d foy)
CGI.pm probs on NT <mudd97@nac.net>
Re: Character entity for <space>? (Abigail)
Re: Character entity for <space>? <jdf@pobox.com>
Re: Character entity for <space>? (Craig Berry)
Re: Character entity for <space>? (I R A Aggie)
Re: Character entity for <space>? (Abigail)
Re: Character entity for <space>? (Craig Berry)
Re: Character entity for <space>? (Craig Berry)
Re: create text file <quednauf@nortel.co.uk>
Debugging <cobalt@dircon.co.uk>
diff like module or code in perl? <lloyd@morpheme.com>
Docs for a2p/walk.c? (Peter J. Farley III)
Finding a value in a string (Mike)
Re: Finding a value in a string (brian d foy)
Re: Finding a value in a string (Mike)
flock() on Linux (Marc Haber)
Re: flock() on Linux (Frank D. Cringle)
fork spawn zombie child process i.e. <defunct> under So <daydreamer_ca@hotmail.com>
Re: fork spawn zombie child process i.e. <defunct> unde <eatonn@msn.com>
Re: fork spawn zombie child process i.e. <defunct> unde <avir@compugen.co.il>
Re: fork spawn zombie child process i.e. <defunct> unde <Eric.Zylberstejn@wanadoo.com>
ftp using perl <bdwornick@usa.net>
Re: ftp using perl <jdf@pobox.com>
GNUperl5 / Sockets.pm <gfowler@bwctc.northants.sch.uk>
Re: GNUS and cperl-mode conflict? <n.koch@delta-ii.de>
Re: GNUS and cperl-mode conflict? (Ilya Zakharevich)
help I'm a beginner <kringdon@bu.edu>
Re: help I'm a beginner (Larry Rosler)
Re: help I'm a beginner <erik@zeno.com>
Re: help I'm a beginner (Larry Rosler)
Re: help I'm a beginner (Martien Verbruggen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 06 Jul 1998 21:18:51 GMT
From: sonigopi@hotmail.com
Subject: CGI.pm Package & redirect
Message-Id: <6nrevr$v02$1@nnrp1.dejanews.com>
Is there a way to redirect to different page WITH parameter attached so that
other script can use the parameters? For example: Script XXX.pl and Script
YYY.pl require date as parameter but XXX.pl processes only Historical dates
where as YYY.pl processes current and future dates. So if I'm in XXX.pl and
send future date to it than XXX.pl should redirect the to YYY.pl with the
date as parameter.
Any Help would be appreciated.
Thanks
soni
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 06 Jul 1998 17:51:59 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI.pm Package & redirect
Message-Id: <comdog-ya02408000R0607981751590001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6nrevr$v02$1@nnrp1.dejanews.com>, sonigopi@hotmail.com posted:
> Is there a way to redirect to different page WITH parameter attached so that
>other script can use the parameters? For example: Script XXX.pl and Script
>YYY.pl require date as parameter but XXX.pl processes only Historical dates
>where as YYY.pl processes current and future dates. So if I'm in XXX.pl and
>send future date to it than XXX.pl should redirect the to YYY.pl with the
>date as parameter.
you can pass any string you like as an argument to the redirect()
method. see the CGI.pm docs for details.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>
------------------------------
Date: Mon, 06 Jul 1998 14:46:38 GMT
From: "Brian Moffatt" <mudd97@nac.net>
Subject: CGI.pm probs on NT
Message-Id: <ir5o1.326$Zo3.6888017@nntp1.nac.net>
I have constructed a table with the following syntax. These th and td are
stacked to create a long table.
My script craps out at the following area (The first th-td). I have no
problem with this syntax on a win95 box running Sambar Server. It craps on
an NT box running IIS.
Please help.
Thanks
th({bgcolor=>FFD7FF}, 'ADDRESS').td([textfield(-name=>'address',
-size=>40,
-maxlength=>80),]),
------------------------------
Date: 6 Jul 1998 17:41:55 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Character entity for <space>?
Message-Id: <6nr293$lr5$1@client3.news.psi.net>
Les Jones (lesONAYAMSPAYjones@usit.net) wrote on MDCCLXIX September
MCMXCIII in <URL: news:lesONAYAMSPAYjones-ya023480000507981828510001@news.usit.net>:
++
++ Clueless Perl newbie alert.
++
++ I've found regexp equivalents for tab (\t), new line (\n), etc., but
++ nothing for the space character. I've consulted three books and two online
++ resources, but they all avoid the space character. What's up with that?
Is there anything wrong with your keyboard? Do you know where that
big button on the bottom side of the keyboard is for?
Abigail
--
Now, where is the regex equivalent of an 'a'?
------------------------------
Date: 06 Jul 1998 14:13:29 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: abigail@fnx.com
Subject: Re: Character entity for <space>?
Message-Id: <r9zyn67a.fsf@mailhost.panix.com>
abigail@fnx.com (Abigail) writes:
> Now, where is the regex equivalent of an 'a'?
[^\x00-\x60\x62-\xff]
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: 6 Jul 1998 18:39:26 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Character entity for <space>?
Message-Id: <6nr5ku$hus$2@marina.cinenet.net>
Abigail (abigail@fnx.com) wrote:
: Les Jones (lesONAYAMSPAYjones@usit.net) wrote on MDCCLXIX September
: MCMXCIII in <URL: news:lesONAYAMSPAYjones-ya023480000507981828510001@news.usit.net>:
: ++ I've found regexp equivalents for tab (\t), new line (\n), etc., but
: ++ nothing for the space character. I've consulted three books and two online
: ++ resources, but they all avoid the space character. What's up with that?
:
: Is there anything wrong with your keyboard? Do you know where that
: big button on the bottom side of the keyboard is for?
To be fair, I've often wished for a visible escape for space, just because
eyeball-parsing / +/ (or more complex cases) is a little hard at 3am.
Maybe \_ ?
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Mon, 06 Jul 1998 15:17:26 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Character entity for <space>?
Message-Id: <fl_aggie-0607981517260001@aggie.coaps.fsu.edu>
In article <6nr5ku$hus$2@marina.cinenet.net>, cberry@cinenet.net (Craig
Berry) wrote:
+ To be fair, I've often wished for a visible escape for space, just because
+ eyeball-parsing / +/ (or more complex cases) is a little hard at 3am.
+ Maybe \_ ?
Ummm...perhaps '\ '?
James
------------------------------
Date: 6 Jul 1998 19:35:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Character entity for <space>?
Message-Id: <6nr8uq$oa6$5@client3.news.psi.net>
Craig Berry (cberry@cinenet.net) wrote on MDCCLXX September MCMXCIII in
<URL: news:6nr5ku$hus$2@marina.cinenet.net>:
++ Abigail (abigail@fnx.com) wrote:
++ : Les Jones (lesONAYAMSPAYjones@usit.net) wrote on MDCCLXIX September
++ : MCMXCIII in <URL: news:lesONAYAMSPAYjones-ya023480000507981828510001@news.usit.net>:
++ : ++ I've found regexp equivalents for tab (\t), new line (\n), etc., but
++ : ++ nothing for the space character. I've consulted three books and two online
++ : ++ resources, but they all avoid the space character. What's up with that?
++ :
++ : Is there anything wrong with your keyboard? Do you know where that
++ : big button on the bottom side of the keyboard is for?
++
++ To be fair, I've often wished for a visible escape for space, just because
++ eyeball-parsing / +/ (or more complex cases) is a little hard at 3am.
++ Maybe \_ ?
\x20 if you must.
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
------------------------------
Date: 6 Jul 1998 21:19:05 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Character entity for <space>?
Message-Id: <6nrf09$2mb$1@marina.cinenet.net>
I R A Aggie (fl_aggie@thepentagon.com) wrote:
: In article <6nr5ku$hus$2@marina.cinenet.net>, cberry@cinenet.net (Craig
: Berry) wrote:
:
: + To be fair, I've often wished for a visible escape for space, just because
: + eyeball-parsing / +/ (or more complex cases) is a little hard at 3am.
: + Maybe \_ ?
:
: Ummm...perhaps '\ '?
Nah, that still leaves me scratching my head for a millisecond -- "escape
what? Oh, space, right."
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 6 Jul 1998 21:20:35 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Character entity for <space>?
Message-Id: <6nrf33$2mb$2@marina.cinenet.net>
Abigail (abigail@fnx.com) wrote:
: ++ To be fair, I've often wished for a visible escape for space, just because
: ++ eyeball-parsing / +/ (or more complex cases) is a little hard at 3am.
: ++ Maybe \_ ?
:
: \x20 if you must.
<joke>But what about ASCII/EBCDIC portability?</joke>
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Mon, 06 Jul 1998 12:02:43 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: create text file
Message-Id: <35A0AED3.4BA7CA80@nortel.co.uk>
tom_lar@my-dejanews.com wrote:
>
> Hi
>
> This is a quite simple question but I can't find the answer to it.
> How do I create a file in Perl?
If you want to write to the file, you can simply open it for writing
open FILE, "> $files{output}" or die "Error on outputfile:$!";
If the file's already been there, it will be truncated.
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: 6 Jul 1998 23:49:09 -0100
From: "Paul Smith" <cobalt@dircon.co.uk>
Subject: Debugging
Message-Id: <01bda930$0e2b6050$e93870c2@vmayadas>
Hi
Can anyone tell me how to inspect LOCAL variables in the debugger?
I'm using X DB varname but this only appears to work for global variables.
Thanks
Vijay
------------------------------
Date: Sun, 05 Jul 1998 23:22:07 -0700
From: Lenny Bruce Lee <lloyd@morpheme.com>
Subject: diff like module or code in perl?
Message-Id: <35A06D0F.B2BA8CA0@morpheme.com>
Does anyone know of a module that implements the unix diff(1) functionality in perl. It would be really great if it
worked on arrays in memory rather than files also. And if anyone has any cake and ice-cream to go with it that would be
even better.
thanks,
-lloyd
--
"The new electronic interdependence recreates the world
in the image of a global village." - Marshall McLuhan
mailto:lloyd@nospam.morpheme.com ----- http://www.morpheme.com
------------------------------
Date: Mon, 06 Jul 1998 04:44:06 GMT
From: pjfarley@banet.net (Peter J. Farley III)
Subject: Docs for a2p/walk.c?
Message-Id: <35a05607.7917166@news1.banet.net>
OK, I'm reading the source for it assiduously, and some things are
clear, and some other things are not. As for why I'm doing it, well
I'm trying to bring a2p up to gawk 3.0.3 level, fixing the known bugs
in the process.
Basically, the grammar needs to be re-written in a fairly major way to
correct the failure to recognize the '>' redirection operator and
concatenating more than two expressions. After studying several
different awk grammars, I believe I understand what needs to be done,
but I need to be able to translate the existing grammar actions to the
new grammar, which will have more nodes and slightly different
structure. Some of the actions translate quite cleanly, but others do
not. I really need to make decisions on structure, like how BEGIN/END
is handled currently (probably keep), but to do certain changes, I
need to understand better how walk.c is designed to work.
It would really be a great help, though, if there was *any* sort of
commentary at all besides the source. TIA for any info or pointers
you can provide on this.
----------------------------------------------------
Peter J. Farley III (pjfarley@nospam.dorsai.org OR
pjfarley@nospam.banet.net)
------------------------------
Date: Tue, 07 Jul 1998 00:04:31 GMT
From: callipygian32@hotmail.com (Mike)
Subject: Finding a value in a string
Message-Id: <35a1666b.1207113737@news.west.net>
I am reading a text file and I need to search for a string in the
file and get the value after the string. The string I am searching
for is BegMessageXX where XX is a number. I can search the string for
BegMessage but how do I find out what the number after that string is
?
I am already doing s/^BegMessage*/i to find out if the line has
that string on it, there is no space between the number and the text
which why I am stuck or I would search for a space.
Thanks for any help, sorry about the hotmail accout but this
way I can ignore the spammers.
mike
------------------------------
Date: Mon, 06 Jul 1998 20:32:00 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Finding a value in a string
Message-Id: <comdog-ya02408000R0607982032000001@news.panix.com>
Keywords: from just another new york perl hacker
In article <35a1666b.1207113737@news.west.net>, callipygian32@hotmail.com (Mike) posted:
> I am reading a text file and I need to search for a string in the
>file and get the value after the string. The string I am searching
>for is BegMessageXX where XX is a number. I can search the string for
>BegMessage but how do I find out what the number after that string is
>?
>
> I am already doing s/^BegMessage*/i to find out if the line has
>that string on it, there is no space between the number and the text
>which why I am stuck or I would search for a space.
hmm...
#store the matching number in a memory variable!
$file =~ m/^BegMessage(\d+)/m;
$number = $1;
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>
------------------------------
Date: Tue, 07 Jul 1998 00:47:20 GMT
From: callipygian32@hotmail.com (Mike)
Subject: Re: Finding a value in a string
Message-Id: <35a16fcf.1209518285@news.west.net>
Thanks to all that have replied to email and this group. You all
guessed right that I was looking for numbers at the end of a string
and the m/^BegMessage(\d+)/ is what I needed, its now working.
I feel stupid, I was stuck on getting a string when I really wanted a
number in a string. But even so I am fairly new to perl and didnt
RTFM enough about m// to see that it would work. Its the \d+ that did
the trick.
Thanks...
mike
------------------------------
Date: Mon, 06 Jul 1998 07:57:16 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: flock() on Linux
Message-Id: <6nq01u$18l$2@nz12.rz.uni-karlsruhe.de>
Hi!
I am trying to use flock() with perl5.004_04 on a Linux 2.0.33 system.
My test program looks like:
#!/usr/bin/perl -w
use Fcntl ':flock';
open BLA, ">bla.lck";
print "trying\n";
print flock(BLA,LOCK_EX+LOCK_NB),"\n";
sleep 20;
close(BLA);
First, I have to notice that my edition of the camel book has a
slightly different explanation of flock() than perldoc -f flock (the
former defining $LOCK_EX and the other constants, the latter useing
Fcntl ':flock').
The first instance of my script runs fine, prints "trying\n1\n" and
sleeps. The second instance started prints "trying\n" and waits until
the first instance has slept enough. Then the second instance pritns
"1\n" and falls asleep.
It looks like LOCK_NB is not performing as expected. What am I doing
wrong?
How will a program behave that does the following:
open TMP_LOCK, ">onefilename";
flock(TMP_LOCK,LOCK_EX);
link($onefilename,$otherfilename);
open LOCK,">otherfilename";
flock(LOCK,LOCK_EX);
Will it get the second lock? Or will it deadlock on itself?
Any hints will be appreciated.
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: Mon, 6 Jul 1998 13:42:34 GMT
From: fdc@cliwe.ping.de (Frank D. Cringle)
Subject: Re: flock() on Linux
Message-Id: <vtyau7xfhx.fsf@cliwe.ping.de>
Marc.Haber-usenet@gmx.de (Marc Haber) writes:
> I am trying to use flock() with perl5.004_04 on a Linux 2.0.33 system.
> My test program looks like:
>
> #!/usr/bin/perl -w
>
> use Fcntl ':flock';
>
> open BLA, ">bla.lck";
>
> print "trying\n";
> print flock(BLA,LOCK_EX+LOCK_NB),"\n";
>
> sleep 20;
>
> close(BLA);
>
> [ ........ ]
>
> It looks like LOCK_NB is not performing as expected. What am I doing
> wrong?
The same thing happens with perl5.004_04 on Solaris 2.5.
You need to replace LOCK_EX+LOCK_NB with LOCK_EX|LOCK_NB. You think
those 2 expressions should be identical (assuming there are no
overlapping bits)? Me too. It isn't the case though.
#!/usr/bin/perl -w
use strict;
use Fcntl ':flock';
print "LOCK_EX=", LOCK_EX, ", LOCK_NB=", LOCK_NB, "\n";
print "(LOCK_EX+LOCK_NB)=", (LOCK_EX+LOCK_NB), "\n";
print "(LOCK_EX)+(LOCK_NB)=", (LOCK_EX)+(LOCK_NB), "\n";
print "LOCK_EX|LOCK_NB=", LOCK_EX|LOCK_NB, "\n"
produces
LOCK_EX=2, LOCK_NB=4
(LOCK_EX+LOCK_NB)=2
(LOCK_EX)+(LOCK_NB)=6
LOCK_EX|LOCK_NB=6
--
Frank Cringle, fdc@cliwe.ping.de
voice: (+49 2304) 467101; fax: 943357
------------------------------
Date: Sun, 05 Jul 1998 19:04:49 -0700
From: Day Dreamer <daydreamer_ca@hotmail.com>
Subject: fork spawn zombie child process i.e. <defunct> under Solaris
Message-Id: <35A030C1.CB9CD48B@hotmail.com>
Hi,
I'm using fork() to generate child process while the parent process
continues to monitor for new request.
However, when the child process is done and exited, the process tale
shows that the process is turned into <defunct> on the Solrais 2.x box.
As the program continues to run over days, I build up hundreds to
thousands of <defunct> processes. The only way that I can kill them is
by restarting my parent process. Is there some other method to handle
this? I would like to avoid restarting the parent program daily. Sun
said that it has to do with how the parent process holds on to the child
process even it it terminates. How can I take care of this issue in Perl
5?
Thanks for all you help.
Sincerely,
Jeff
daydreamer_ca@hotmail.com
------------------------------
Date: Sun, 5 Jul 1998 23:16:17 -0500
From: "Nathan Eaton" <eatonn@msn.com>
Subject: Re: fork spawn zombie child process i.e. <defunct> under Solaris
Message-Id: <e#rqDUJq9GA.91@upnetnews03>
Day Dreamer wrote in message <35A030C1.CB9CD48B@hotmail.com>...
>Hi,
>
>I'm using fork() to generate child process while the parent process
>continues to monitor for new request.
>
>However, when the child process is done and exited, the process tale
>shows that the process is turned into <defunct> on the Solrais 2.x box.
Check out the first edition of "Programming Perl". All I have here at home
is the the second edition, but the first edition has an example of what you
want to do.
Regards,
Nathan
------------------------------
Date: Mon, 06 Jul 1998 10:26:44 +0300
From: Avi Rosenberg <avir@compugen.co.il>
To: Day Dreamer <daydreamer_ca@hotmail.com>
Subject: Re: fork spawn zombie child process i.e. <defunct> under Solaris
Message-Id: <35A07C34.B7CDC9ED@compugen.co.il>
Day Dreamer wrote:
>
> Hi,
>
> I'm using fork() to generate child process while the parent process
> continues to monitor for new request.
>
> However, when the child process is done and exited, the process tale
> shows that the process is turned into <defunct> on the Solrais 2.x box.
> As the program continues to run over days, I build up hundreds to
> thousands of <defunct> processes. The only way that I can kill them is
> by restarting my parent process. Is there some other method to handle
> this? I would like to avoid restarting the parent program daily. Sun
> said that it has to do with how the parent process holds on to the child
> process even it it terminates. How can I take care of this issue in Perl
> 5?
>
> Thanks for all you help.
>
> Sincerely,
>
> Jeff
> daydreamer_ca@hotmail.com
When you fork, and generate a child process you must (at some time) wait
for the process - either with the wait command (which waits for any
child
process to end), or with the waitpid command (which waits for a specific
known process number).
The problem with this, is that the once the parent process waits for
a child process, it "hangs" (i.e. is suspended until the child process
ends and returns a signal to the parent). Now, on some systems (and I
do believe that Solaris 2.x is one of them - at least by my checking on
our Solaris 2.6), You can do a non-blocking wait (i.e. the parent
process
will "harvest" the child process if it has finished, or continue working
if the child process hasn't finished), doing this thing:
use POSIX ":sys_wait_h";
...
waitpid(mychildpid,&WNOHANG);
Of course, you still have to take care of the list of child processes
you created, once in a while do a non-blocked waitpid call for all of
them, and remove the ones you have already "harvested" - you can know
which one you harvested, since the value returned from the waitpid call
is
0 if you didn't harvest it (i.e. it hasn't finished yet), it's pid
number
if you did or -1 if there is no process with that pid (i.e. you already
harvested it - this shouldn't happen!).
Your truly
avi
--
***********************************************************************
Avi Yeshah Rosenberg "GCCGTAATCCGG"
Compugen Ltd. Tel: +972-3-9348482
17 Hamacabim St. Fax: +972-3-9348489
Petach-Tikva, 49220 E-mail: avir@compugen.co.il
Israel WWW: http://www.cgen.com
**********************************************************************
------------------------------
Date: Mon, 06 Jul 1998 13:17:28 +0200
From: Eric Zylberstejn <Eric.Zylberstejn@wanadoo.com>
To: Day Dreamer <daydreamer_ca@hotmail.com>
Subject: Re: fork spawn zombie child process i.e. <defunct> under Solaris
Message-Id: <35A0B248.5879E94C@wanadoo.com>
This is a multi-part message in MIME format.
--------------B43AB343862BC7CEFB3C4612
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Day Dreamer wrote:
>
> Hi,
>
> I'm using fork() to generate child process while the parent process
> continues to monitor for new request.
>
> However, when the child process is done and exited, the process tale
> shows that the process is turned into <defunct> on the Solrais 2.x box.
Add this to your parent :
# Wait for children
$SIG{CHLD} = sub { wait };
Eric
--------------B43AB343862BC7CEFB3C4612
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Zylberstejn, Eric
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Eric Zylberstejn
n: Zylberstejn;Eric
org: FTI
adr: 41 r Camille Desmoulins;;;Issy-les-Moulineaux;;92130;France
email;internet: Eric.Zylberstejn@wanadoo.com
tel;work: 01 41 33 94 59
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
--------------B43AB343862BC7CEFB3C4612--
------------------------------
Date: Mon, 06 Jul 1998 22:50:39 GMT
From: Brian Dwornick <bdwornick@usa.net>
Subject: ftp using perl
Message-Id: <35A153A1.8798512D@usa.net>
Hello,
I would like to be able to make a script that would allow a user to
access and edit a page on a different server through FTP. The user
would give their username, password, and ftp server name. The script
would then open the file and and allow the user to edit it with a html
editor in the script. Then the user would be able to save the file to
their ftp server.
Can this be done with perl? I can't find it anywhere.
The problem is accessing and saving an un-anonymous FTP server.
Please Help,
Brian Dwornick
------------------------------
Date: 06 Jul 1998 19:47:11 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Brian Dwornick <bdwornick@usa.net>
Subject: Re: ftp using perl
Message-Id: <pvfiebcg.fsf@mailhost.panix.com>
Brian Dwornick <bdwornick@usa.net> writes:
> The problem is accessing and saving an un-anonymous FTP server.
No problem: just obtain the Net::FTP module from the CPAN (if you
don't already have it), install it, and read the documentation. It's
trivial to connect to an FTP server with an arbitrary username and
password.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Mon, 06 Jul 1998 17:52:20 +0100
From: Graeme Fowler <gfowler@bwctc.northants.sch.uk>
Subject: GNUperl5 / Sockets.pm
Message-Id: <35A1009A.3613DD60@bwctc.northants.sch.uk>
Why when I try to run any code which requires sockets, do I get the
following error:
> >Can't call method "import" in empty package "Socket" at Socket.pm line 41.
> >BEGIN failed--compilation aborted at Socket.pm line 41.
>
Socket.pm contains (relevant bit):
line 39: use Socket qw(pack_sockaddr_in unpack_sockaddr_in
line 40: PF_INET SOCK_STREAM INADDR_ANY
line 41: inet_ntoa inet_aton);
It's GNUperl5.003-libwww running on Solaris 2.5.1 (Sparc)
------------------------------
Date: 06 Jul 1998 07:00:39 +0200
From: Norbert Koch <n.koch@delta-ii.de>
Subject: Re: GNUS and cperl-mode conflict?
Message-Id: <vok95rtvyg.fsf@lamia.delta-ii.de>
Jeremy D Zawodny writes:
> Is this a known problem? How can I diagnose/fix it? My gut feeling
> is that cperl-mode is somehow responsible, but that's just
> speculation on my part.
Hi,
set debug-on-error to 't' and try to decipher the backtrace of the
error. Send it either to the gnus or the c-perl bug-fixing boys and
girls :-)
Cheers, norbert.
--
Norbert Koch, DELTA Industrie Informatik GmbH, Fellbach, Germany.
YOW: ...I think I'm having an overnight sensation right now!!
------------------------------
Date: 6 Jul 1998 19:56:19 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: GNUS and cperl-mode conflict?
Message-Id: <6nra53$gi3$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Jeremy D. Zawodny
<jzawodn@wcnet.org>],
who wrote in article <m3n2aprlyi.fsf@peach.z.org>:
> This is an odd one I've stumbled upon. I'm using
>
> Emacs 20.2 on RadHat Linux 4.2
> Ilya's cperl-mode 3.6
> GNUS 5.6.23.
[...]
> Wrong type argument: buffer-or-string-p, t
>
> The last line, of course, being the clincher.
>
> Is this a known problem? How can I diagnose/fix it? My gut feeling is
> that cperl-mode is somehow responsible, but that's just speculation on
> my part.
Yes, it is a known problem, it should be documented in CPerl online
docs, and the patches to Emacs C code are available at CPerl
directories, say, on
ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
Feel free to apply all the 20.2-patches there (but the latest one is
an optimization only).
Ilya
------------------------------
Date: Mon, 06 Jul 1998 15:19:00 -0400
From: kringdon <kringdon@bu.edu>
Subject: help I'm a beginner
Message-Id: <35A12324.E02A6A40@bu.edu>
I know to most of you this will be kind of easy, but I was wondering if
there was a way to count characters from a line. It doesn't really
mention any of that in the book I have so I was wondering if you guys
can help me out. For instance if this was a line :
Hello I am going insane.\n
I can get the number of caharacters to be 26 and store that in a
variable.
This is my 2nd week with the language and I was hoping you guys know
the answer. Thanks
------------------------------
Date: Mon, 6 Jul 1998 12:42:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: help I'm a beginner
Message-Id: <MPG.100ac89c4d462dd49896e7@nntp.hpl.hp.com>
In article <35A12324.E02A6A40@bu.edu> on Mon, 06 Jul 1998 15:19:00 -0400,
kringdon <kringdon@bu.edu> says...
> I know to most of you this will be kind of easy, but I was wondering if
> there was a way to count characters from a line. It doesn't really
> mention any of that in the book I have so I was wondering if you guys
> can help me out. For instance if this was a line :
>
> Hello I am going insane.\n
>
> I can get the number of caharacters to be 26 and store that in a
> variable.
The function is length(). You can learn about it by executing the
command
perldoc -f length
If your book is 'Learning Perl' you will find 'length()' in the index,
pointing to examples, though it isn't discussed formally in the text
proper.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 6 Jul 1998 15:28:13 -0700
From: "Erik" <erik@zeno.com>
Subject: Re: help I'm a beginner
Message-Id: <6nriuq$stv$1@nntp1.ni.net>
Ya know, something funny about length.. you might think that it would treat
8.10 as a string and return 4... but in fact it returns 3, and this only
seems to happen if you use length on a number where the last digit is 0.
A better way is:
$num = 8.10;
$num =~ tr/0-9A-Za-z/0-9A-Za-z/r; # (I forget what goes here, but probably
an
r)
This would return 4 rather than 3.
Erik
>The function is length(). You can learn about it by executing the
>command
------------------------------
Date: Mon, 6 Jul 1998 16:16:05 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: help I'm a beginner
Message-Id: <MPG.100afa9344343f6d9896ea@nntp.hpl.hp.com>
In article <6nriuq$stv$1@nntp1.ni.net> on Mon, 6 Jul 1998 15:28:13 -0700,
Erik <erik@zeno.com> says...
> Ya know, something funny about length.. you might think that it would treat
> 8.10 as a string and return 4... but in fact it returns 3, and this only
> seems to happen if you use length on a number where the last digit is 0.
>
> A better way is:
>
> $num = 8.10;
> $num =~ tr/0-9A-Za-z/0-9A-Za-z/r; # (I forget what goes here, but probably
> an
> r)
>
> This would return 4 rather than 3.
PLEASE don't post solutions that begin 'A better way is:' off the top of
your head, without *both* looking at the documentation *and* testing the
code.
1. The expression you were trying to present should be simply
$num =~ tr/whatever//
whose value is the number of matches in the set of characters between the
first two slashes.
2. You left out the '.' in your set of characters. This just shows how
silly it is to attempt such an enumeration.
3. Even if your set were complete, the expression would still have the
value 3, because the internal storage of $num = 8.10 is identical to 8.1
or 8.1000000. It is the set of bits that when interpreted *as a number*
produces 8.1 . If you want the string '8.10', then you must store it as
a string:
$num = '8.10';
and length $num is indeed 4.
You may be competing for the record for the highest number of errors per
line of code. :-)
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 6 Jul 1998 23:21:12 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: help I'm a beginner
Message-Id: <6nrm58$h8b$2@comdyn.comdyn.com.au>
In article <6nriuq$stv$1@nntp1.ni.net>,
"Erik" <erik@zeno.com> writes:
> Ya know, something funny about length.. you might think that it would treat
> 8.10 as a string and return 4... but in fact it returns 3, and this only
> seems to happen if you use length on a number where the last digit is 0.
Give this a try:
$num = 8.10;
print $num, " - ", length($num), "\n";
$num = "8.10";
print $num, " - ", length($num), "\n";
You'll notice that in the first instance, perl gets rid of the last 0,
because it interprets $num as a number, which is correct. If you want
it to be a string, you should make that clear. Perl does make a
distinction between numbers and strings, but it can convert silently
from one to the other if needed. This is all explained in the
documentation.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In the fight between you and the world,
Commercial Dynamics Pty. Ltd. | back the world - Franz Kafka
NSW, Australia |
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 3068
**************************************