[25931] in Perl-Users-Digest
Perl-Users Digest, Issue: 8151 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 6 06:05:51 2005
Date: Mon, 6 Jun 2005 03:05:05 -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 Mon, 6 Jun 2005 Volume: 10 Number: 8151
Today's topics:
Re: book "perl medic": any good? <dha@panix.com>
Re: book "perl medic": any good? <dave@dave.org.uk>
Re: Editors that use embedded Perl as their macro langu usenet@isbd.co.uk
Re: How to find a perl programer <john@castleamber.com>
Possible bug in 5.8.6: accept/fork/wait/exit ? <jsm@jmarshall.com>
Re: Possible bug in 5.8.6: accept/fork/wait/exit ? xhoster@gmail.com
Randomly selecting Variables <georgekinley@hotmail.com>
Re: Randomly selecting Variables (Anno Siegel)
Variable question <raj.kothary@thus.net>
Re: Variable question (Anno Siegel)
Re: Variable question <raj.kothary@thus.net>
Re: Variable question (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 6 Jun 2005 01:44:23 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: book "perl medic": any good?
Message-Id: <slrnda7ajn.pqt.dha@panix2.panix.com>
On 2005-06-04, Robert <sigzero@gmail.com> wrote:
> On 6/4/05 1:39 PM, in article d7sp0r$snv$1@panix3.panix.com, "David Combs"
><dkcombs@panix.com> wrote:
>
>> Saw a reference to a new-to-me book "Perl Medic". Anyone seen it?
>> Anyone have it?
>>
>> What opinion?
>>
>
> I have it and I think it is a really good book.
Same here.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
A tautology is a thing that is tautological.
- Greg Bacon
------------------------------
Date: Mon, 06 Jun 2005 07:03:51 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: book "perl medic": any good?
Message-Id: <pan.2005.06.06.06.03.51.589248@dave.org.uk>
On Sat, 04 Jun 2005 13:39:39 -0400, David Combs wrote:
> Saw a reference to a new-to-me book "Perl Medic". Anyone seen it?
> Anyone have it?
>
> What opinion?
It's _very_ good.
See http://books.perl.org/book/212
Dave...
------------------------------
Date: 6 Jun 2005 08:31:03 GMT
From: usenet@isbd.co.uk
Subject: Re: Editors that use embedded Perl as their macro language?
Message-Id: <3gifu7Fclbq1U1@individual.net>
burlo.stumproot@gmail.com wrote:
> "Dean Hannotte" <dhannotte@nyc.rr.com> writes:
>
> > I have been using Mansfield Software's KEDIT, which was based on IBM's
> > XEDIT, every day for 25 years. I love it, but the macro language is a
> > lifeless subset of Rexx. Does anyone know if any serious text editors use
> > embedded Perl as their macro language? That would be insanely great.
> >
> > Dean Hannotte
> > http://www.hannotte.net
>
> Emacs, kind of...
> Read "Customizing Emacs with Perl"
> at http://www.perl.com/pub/a/2005/03/31/lightning2.html
>
vile (and xvile) a vi clone uses perl as its scripting language. It's
been my editor of choice for many years now on Solaris, Linux and
Windows PCs.
--
Chris Green
------------------------------
Date: 5 Jun 2005 23:29:00 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: How to find a perl programer
Message-Id: <Xns966CBBE8C6632castleamber@130.133.1.4>
Scott Bryce wrote:
> hope@hope.com wrote:
>> Hi all
>>
>> Can anyone point me in the right places to find a perl programmer who
>> can alter a existing perl/cgi script in the UK
>
> alt.comp.perlcgi.freelance
Last time I hanged out there (if I remember correctly) there where 3 people
hanging there too, including me :-)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Sun, 5 Jun 2005 19:29:13 -0700
From: James Marshall <jsm@jmarshall.com>
Subject: Possible bug in 5.8.6: accept/fork/wait/exit ?
Message-Id: <20050605184546.L27654@jmarshall.com>
Any multi-process/networking gurus here?
I'm trying to write a simple forking HTTP proxy but am having a problem
when running it with Perl 5.8.6. The program spontaneously exits after
one or a few connections. The problem does not happen when I use Perl
5.6.1. I'm running this on Linux with the 2.6.11.4-20a-default kernel
(SuSE 9.3).
Here's a short program that demonstrates it, between the bars below. To
see the problem: First, run this program from one shell prompt. Then,
from another shell prompt, run "telnet localhost 8001". The connection is
made then closed, as expected. You can see the output in the first shell
window. Now, repeat the telnet command over and over. After 1-20
telnets, the script exits with no message.
----------------------------------------------------------------
#!/usr/bin/perl -w
use strict ;
use Socket ;
use vars qw($LISTEN_PORT $paddr $pid $conn_id) ;
$LISTEN_PORT= shift || 8001 ;
# clean up zombies
$SIG{CHLD}= sub { wait } ;
print "Starting $0, listening on port $LISTEN_PORT.\n" ;
# Set up the listening socket
socket(S_LISTEN, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or die ;
setsockopt(S_LISTEN, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) or die ;
bind(S_LISTEN, sockaddr_in($LISTEN_PORT, INADDR_ANY)) or die $! ;
listen(S_LISTEN,SOMAXCONN) or die ;
# Accept one connection at a time, and fork a new process to handle it.
for ( ; $paddr= accept(S_CLIENT, S_LISTEN) ; close S_CLIENT) {
$conn_id++ ;
select((select(S_CLIENT), $|=1)[0]) ; # unbuffer the socket
if ($pid= fork) { # parent process
print "starting parent, conn=$conn_id, pid=$$\n" ;
next ;
} else { # child process
print "starting child, conn=$conn_id, pid=$$\n" ;
exit ;
}
}
----------------------------------------------------------------
The problem goes away if I comment out either the exit statement, or the
$SIG{CHLD} statement. Of course, neither one is acceptable, because all
the extra processes would keep hanging around (either as processes or
zombies). If the for() loop is replaced with a simple "while (1)" loop,
the problem goes away, so the accept() seems to be part of the problem.
Does anyone have any ideas of why this is happening, or suggested
workarounds? Do you see something I'm missing?
Thanks a lot for any help!
James
............................................................................
James Marshall james@jmarshall.com Berkeley, CA @}-'-,--
"Teach people what you know."
............................................................................
------------------------------
Date: 06 Jun 2005 02:52:25 GMT
From: xhoster@gmail.com
Subject: Re: Possible bug in 5.8.6: accept/fork/wait/exit ?
Message-Id: <20050605225225.689$sc@newsreader.com>
james@jmarshall.com wrote:
> Any multi-process/networking gurus here?
>
> I'm trying to write a simple forking HTTP proxy but am having a problem
> when running it with Perl 5.8.6. The program spontaneously exits after
> one or a few connections. The problem does not happen when I use Perl
> 5.6.1.
I also don't see the problem on 5.8.0 or 5.8.3.
...
> shell window. Now, repeat the telnet command over and over. After 1-20
> telnets, the script exits with no message.
That is not surprising, since you don't ask for a message.
> for ( ; $paddr= accept(S_CLIENT, S_LISTEN) ; close S_CLIENT) {
for ( ; $paddr= accept(S_CLIENT, S_LISTEN) or die $!; close S_CLIENT) {
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Mon, 06 Jun 2005 09:48:05 GMT
From: "George" <georgekinley@hotmail.com>
Subject: Randomly selecting Variables
Message-Id: <xn0e36dn59tzpr4002@news.europe.nokia.com>
Hi,
I am sorry and not sure if this query is directly related to perl, but
since I want to do this trick in perl so
I have a 30 variables out of which I need to randomly select 15 and
then randomly equate them numbers between 01 and 90,
Thanks
------------------------------
Date: 6 Jun 2005 09:49:47 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Randomly selecting Variables
Message-Id: <d8167r$94o$2@mamenchi.zrz.TU-Berlin.DE>
George <georgekinley@hotmail.com> wrote in comp.lang.perl.misc:
> Hi,
> I am sorry and not sure if this query is directly related to perl, but
> since I want to do this trick in perl so
>
> I have a 30 variables out of which I need to randomly select 15 and
Read "perldoc -q shuffle" and adapt it to your situation.
> then randomly equate them numbers between 01 and 90,
If "equate" means what I would call "assign" that should be easy.
Anno
------------------------------
Date: Mon, 6 Jun 2005 10:32:15 +0100
From: "Raj" <raj.kothary@thus.net>
Subject: Variable question
Message-Id: <d815af$qoc$1$8300dec7@news.demon.co.uk>
Hi,
I was wondering what this means:
$opt_f = $Name::Email::Config::config_dir.'/email-config.xml'
unless $opt_f;
I've not seen the $Name::Email::Config::config_dir notation before so I was
wondering if someone could explain.
Thanks in advance for enlightening me!
Regards
--
Raj Kothary :: one|concept
------------------------------
Date: 6 Jun 2005 09:40:23 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Variable question
Message-Id: <d815m7$94o$1@mamenchi.zrz.TU-Berlin.DE>
Raj <raj.kothary@thus.net> wrote in comp.lang.perl.misc:
> Hi,
>
> I was wondering what this means:
>
> $opt_f = $Name::Email::Config::config_dir.'/email-config.xml'
> unless $opt_f;
>
> I've not seen the $Name::Email::Config::config_dir notation before so I was
> wondering if someone could explain.
It's the scalar variable $config_dir in the package Name::Email::Config.
See perldoc perldata.
Anno
------------------------------
Date: Mon, 6 Jun 2005 10:46:04 +0100
From: "Raj" <raj.kothary@thus.net>
Subject: Re: Variable question
Message-Id: <d8164c$t4r$1$8302bc10@news.demon.co.uk>
"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:d815m7$94o$1@mamenchi.zrz.TU-Berlin.DE...
> Raj <raj.kothary@thus.net> wrote in comp.lang.perl.misc:
>> Hi,
>>
>> I was wondering what this means:
>>
>> $opt_f = $Name::Email::Config::config_dir.'/email-config.xml'
>> unless $opt_f;
>>
>> I've not seen the $Name::Email::Config::config_dir notation before so I
>> was
>> wondering if someone could explain.
>
> It's the scalar variable $config_dir in the package Name::Email::Config.
> See perldoc perldata.
Hi Anno,
That's exactly what I thought it was...however I cannot find a package
called Name::Email::Config, which is why I got confused.
I will obviously have to dig around a bit more to find out where it is!
Thanks for your help.
Regards,
Raj
> Anno
------------------------------
Date: 6 Jun 2005 10:01:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Variable question
Message-Id: <d816tp$94o$3@mamenchi.zrz.TU-Berlin.DE>
Raj <raj.kothary@thus.net> wrote in comp.lang.perl.misc:
> "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
> news:d815m7$94o$1@mamenchi.zrz.TU-Berlin.DE...
> > Raj <raj.kothary@thus.net> wrote in comp.lang.perl.misc:
> >> Hi,
> >>
> >> I was wondering what this means:
> >>
> >> $opt_f = $Name::Email::Config::config_dir.'/email-config.xml'
> >> unless $opt_f;
> >>
> >> I've not seen the $Name::Email::Config::config_dir notation before so I
> >> was
> >> wondering if someone could explain.
> >
> > It's the scalar variable $config_dir in the package Name::Email::Config.
> > See perldoc perldata.
>
> Hi Anno,
>
> That's exactly what I thought it was...however I cannot find a package
> called Name::Email::Config, which is why I got confused.
It doesn't have to be defined or been used for anything else. The
package is created when it doesn't exist. It wouldn't make much sense
to use a package for just a single scalar, but it's certainly possible.
Anno
------------------------------
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 8151
***************************************