[26483] in Perl-Users-Digest
Perl-Users Digest, Issue: 8645 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 8 18:05:18 2005
Date: Tue, 8 Nov 2005 15:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 8 Nov 2005 Volume: 10 Number: 8645
Today's topics:
fork() or threads <_remove_diz_if_you_want_fisher@uch.net>
Re: fork() or threads <_remove_diz_if_you_want_fisher@uch.net>
Re: fork() or threads <jgibson@mail.arc.nasa.gov>
Re: how to do this job using perl? <darkon.tdo@gmail.com>
Re: how to do this job using perl? <1usa@llenroc.ude.invalid>
Re: why the perl documents is hard to understand? <xli6@gmu.edu>
Re: why the perl documents is hard to understand? <emschwar@pobox.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 8 Nov 2005 22:23:34 +0200
From: "Serge A. Ribalchenko" <_remove_diz_if_you_want_fisher@uch.net>
Subject: fork() or threads
Message-Id: <20051108222334.03125f9e._remove_diz_if_you_want_fisher@uch.net>
--Signature=_Tue__8_Nov_2005_22_23_35_+0200_gY/QhBUwgf5ZwNrF
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Guys,
I am really sorry I feel it can blow a flame, but I need an advice.
Tomorrow I need to write a daemon which would create some outgoing tcp
connections. 'Cause I just never did it before, I found myself in doubt what
will be better to use - a pool of fork()-ed progs or use some nice module like
"threads". The main requirement is speed. What should I use?
--
Best wishes,
~ Serge. pubkeys: http://uch.net/~fisher/keys.asc
~fingerprint : 4346 2766 BC96 E77F 5BFF 1E7C 12C2 3852 E5FD DC34
--Signature=_Tue__8_Nov_2005_22_23_35_+0200_gY/QhBUwgf5ZwNrF
Content-Type: application/pgp-signature
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFDcQlwX9BKv7kKDR0RAgg5AJkBbvlQRImul9mbfPJqTajXwv+crACfb5bf
dOy06yFF16gEPcWENblVLw8=
=fEye
-----END PGP SIGNATURE-----
--Signature=_Tue__8_Nov_2005_22_23_35_+0200_gY/QhBUwgf5ZwNrF--
------------------------------
Date: Tue, 8 Nov 2005 23:43:00 +0200
From: "Serge A. Ribalchenko" <_remove_diz_if_you_want_fisher@uch.net>
Subject: Re: fork() or threads
Message-Id: <20051108234300.24cba924._remove_diz_if_you_want_fisher@uch.net>
--Signature=_Tue__8_Nov_2005_23_43_00_+0200__o76fCpHUSDHHNdi
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
On 8 Nov 2005 21:24:14 GMT
John Bokma <john@castleamber.com> wrote:
> > I am really sorry I feel it can blow a flame, but I need an advice.
> > Tomorrow I need to write a daemon which would create some outgoing tcp
> > connections. 'Cause I just never did it before, I found myself in
> > doubt what will be better to use - a pool of fork()-ed progs or use
> > some nice module like "threads". The main requirement is speed. What
> > should I use?
>
> On Windows, AFAIK, fork is implemented using threads :-D.
Oh I'm sorry, forgot to specify system - GNU/Linux 2.6.x
--
Best wishes,
~ Serge. pubkeys: http://uch.net/~fisher/keys.asc
~fingerprint : 4346 2766 BC96 E77F 5BFF 1E7C 12C2 3852 E5FD DC34
--Signature=_Tue__8_Nov_2005_23_43_00_+0200__o76fCpHUSDHHNdi
Content-Type: application/pgp-signature
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFDcRvrX9BKv7kKDR0RAqDCAJwK0lC6IMz/frDF6YsoriqQ2KMzngCcCjbY
OJyL0Ftkbwy4Wzy9Jx8A21U=
=2D0Z
-----END PGP SIGNATURE-----
--Signature=_Tue__8_Nov_2005_23_43_00_+0200__o76fCpHUSDHHNdi--
------------------------------
Date: Tue, 08 Nov 2005 14:01:34 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: fork() or threads
Message-Id: <081120051401345108%jgibson@mail.arc.nasa.gov>
In article
<20051108222334.03125f9e._remove_diz_if_you_want_fisher@uch.net>, Serge
A. Ribalchenko <_remove_diz_if_you_want_fisher@uch.net> wrote:
> Guys,
>
> I am really sorry I feel it can blow a flame, but I need an advice.
> Tomorrow I need to write a daemon which would create some outgoing tcp
> connections. 'Cause I just never did it before, I found myself in doubt what
> will be better to use - a pool of fork()-ed progs or use some nice module like
> "threads". The main requirement is speed. What should I use?
You don't need either. You can create multiple socket connections in
one execution stream (process or thread) and use the select statement
(the 4-argument version) to detect when input is ready or output is
possible on any of the set of sockets. There are socket modules to
help, e.g. IO::Socket.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Tue, 08 Nov 2005 20:20:08 -0000
From: "David K. Wall" <darkon.tdo@gmail.com>
Subject: Re: how to do this job using perl?
Message-Id: <Xns97089BFF7A621dkwwashere@216.168.3.30>
sonet <sonet.all@msa.hinet.net> wrote:
> #items parent
> 01.attr 0
> 02.attr 0
> 04.attr 01.attr
> 03.attr 01.attr
> 06.attr 02.attr
> 07.attr 03.attr
> 08.attr 03.attr
> 09.attr 07.attr
>=========================================
> transform to this form
> ps: The order must follow above
>=========================================
> 01.attr
> 04.attr
> 03.attr
> 07.attr
> 09.attr
> 08.attr
> 02.attr
See if the post at
http://groups.google.com/group/comp.lang.perl.misc/msg/55ee2e6f76c4cbeb
helps any. It's a similar idea.
------------------------------
Date: Tue, 8 Nov 2005 21:02:57 +0000 (UTC)
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: how to do this job using perl?
Message-Id: <Xns9708A342AB580asu1cornelledu@132.236.56.8>
"sonet" <sonet.all@msa.hinet.net> wrote in
news:dkqiin$72v$1@netnews.hinet.net:
[ Please do not top-post ]
> "sonet" <sonet.all@msa.hinet.net> ¦b¶l¥ó
> news:dkqg48$fgs$1@netnews.hinet.net ¤¤¼¶¼g...
>> #items parent
>> 01.attr 0
>> 02.attr 0
>> 04.attr 01.attr
>> 03.attr 01.attr
>> 06.attr 02.attr
>> 07.attr 03.attr
>> 08.attr 03.attr
>> 09.attr 07.attr
>> =========================================
>> transform to this form
>> ps: The order must follow above
>> =========================================
>> 01.attr
>> 04.attr
>> 03.attr
>> 07.attr
>> 09.attr
>> 08.attr
>> 02.attr
>
>
> First, this is not a homework.
That is good.
> The Tree::Simple can do this job after i search modules in CPAN.
> But i don't want to do this by modules only if i can not slove it.
That's admirable. I think you should give it a try, and post your best
attempt. That will make it *easier* for us to help you.
> Sorry! My mother language is not english.And my english is very poor.
There is no need to apologize for poor English, especially if you post
code, because then we can figure out what you are trying to do and what
is not working by looking at the code. That is why the posting guidelines
recommend:
Speak Perl rather than English, when possible
Perl is much more precise than natural language. Saying it in
Perl instead will avoid misunderstanding your question or problem.
Do not say: I have variable with ``foo\tbar'' in it.
Instead say: I have $var = ``foo\tbar'', or I have $var = 'foo\tbar',
or I have $var = <DATA> (and show the data line).
You can find the posting guidelines at
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
Do read them, they contain invaluable pointers on how to help yourself,
and help others help you.
> Just give a suggestion.
Use a hash :) (just joking)
The question itself is a little more complicated than I can figure out
right now (which is why I personally would use the module for the
immediate problem, and then try to read the source code, or consult an
algorithms book to see how to do it).
Sinan
------------------------------
Date: Tue, 08 Nov 2005 18:59:17 +0000
From: Xiaoshen Li <xli6@gmu.edu>
Subject: Re: why the perl documents is hard to understand?
Message-Id: <dkr9ob$fb2m$1@osf1.gmu.edu>
I cannot give out specific examples. But believe me, print out a couple
of descriptions of functions in Perl and go to talk to some *good*
college students major in literature, explain clearly to them what each
function does in Perl, and ask them write down the descriptions with
similar amount of words. I bet, the "documentation" from them is much
better.
I am criticizing the English language skill of the writer. Writing is
not a simple thing. It is an art.
In my life, many times I have seen that one word or one sentence
explains one concept clearly, while some people use four or five
sentences still cannot do it, instead they made the concept more
confusing and "mysterious".
------------------------------
Date: Tue, 08 Nov 2005 15:52:25 -0700
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: why the perl documents is hard to understand?
Message-Id: <eto4q6m3g7q.fsf@wilson.emschwar>
Xiaoshen Li <xli6@gmu.edu> writes:
> I cannot give out specific examples.
Then all you are doing is whining, and your opinions deserve no
attention. If the prevalence of bad docs is as high as you seem to
think, then it should be easy to pick out one specific function whose
docs you don't feel are up to snuff.
> But believe me, print out a couple
> of descriptions of functions in Perl and go to talk to some *good*
> college students major in literature, explain clearly to them what each
> function does in Perl, and ask them write down the descriptions with
> similar amount of words. I bet, the "documentation" from them is much
> better.
Why literature majors? Why not drama, or sculpture? Perl docs are
written for programmers, not English majors. What's important is that
a programmer can read them and understand. What is more readable to a
literature student is quite likely to be incomprehensible to a
programmer, and given that the odds are pretty strong that the former
will never write any Perl, and the latter will, I'd prefer to bias the
documentation so that programmers can understand it best.
> I am criticizing the English language skill of the writer. Writing is
> not a simple thing. It is an art.
Art is all about communication (in my view), and that implies knowing
your audience. The online Perl docs are generally written for
programmers. If you want docs written for a more general audience,
that's fine, but you want to read any of the several books directed at
that market, not the online Perl docs.
> In my life, many times I have seen that one word or one sentence
> explains one concept clearly, while some people use four or five
> sentences still cannot do it, instead they made the concept more
> confusing and "mysterious".
That's nice. But if you don't tell us what you find objectionable, we
can hardly improve anything. Give us a concrete example, or kindly
stop whining. Either one would be fine, really.
-=Eric
------------------------------
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 8645
***************************************