[26740] in Perl-Users-Digest
Perl-Users Digest, Issue: 8825 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 4 14:05:12 2006
Date: Wed, 4 Jan 2006 11:05:04 -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 Wed, 4 Jan 2006 Volume: 10 Number: 8825
Today's topics:
Re: calling subroutine <joe@inwap.com>
cut -c18-31,49-51 in perl? <jidanni@jidanni.org>
Re: cut -c18-31,49-51 in perl? <rvtol+news@isolution.nl>
Re: IO::Pipe and loss of data xhoster@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 04 Jan 2006 08:10:15 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: calling subroutine
Message-Id: <3YKdnfk1W_P2bibenZ2dnUVZ_s6dnZ2d@comcast.com>
Madhu Ramachandran wrote:
> did stupid mistake.. typo in calling place.
That's why you should always copy-and-paste the code in
question; don't re-type it.
------------------------------
Date: Thu, 05 Jan 2006 01:43:20 +0800
From: Dan Jacobson <jidanni@jidanni.org>
Subject: cut -c18-31,49-51 in perl?
Message-Id: <87irszdh3b.fsf@jidanni.org>
$ perldoc -q cut #no help, so asking here.
How do I emulate UNIX's "cut -c18-31,49-51"?
Certainly there is no one-liner possible unless I express the ranges
differently?
------------------------------
Date: Wed, 4 Jan 2006 19:50:40 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: cut -c18-31,49-51 in perl?
Message-Id: <dph998.1ek.1@news.isolution.nl>
Dan Jacobson schreef:
> How do I emulate UNIX's "cut -c18-31,49-51"?
> Certainly there is no one-liner possible unless I express the ranges
> differently?
perldoc perlrun
The options -e -l -n -p.
perldoc perlre
s/^.{17}(.{14}).{17}(.{1,3})/$1$2/
|| s/^.{17}(.{1,14})/$1/;
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 04 Jan 2006 16:30:16 GMT
From: xhoster@gmail.com
Subject: Re: IO::Pipe and loss of data
Message-Id: <20060104113016.786$by@newsreader.com>
"Genevieve S." <none@here.com> wrote:
> Hello,
>
> I use the module IO::Pipe to have many process-childen communicate to
> their father. As they are all sending the same kind of information (and
> the father has not the time to listen to a pipe for each of the
> processes),
How much time do you expect that to take?
> only one pipe-object is used for it. Everything seemed to be
> ok, but then I noticed a loss of data - a small one but at least a loss.
> Then I decided to use a message id to check if the loss was within the
> pipe or my code. To have it in numbers: I have 71 child-processes which
> were sending between 400 and 400,000 messages to the father. That father
> found 6 cases, where between 2 and 10 message seemed to got lost when
> sent through the pipe.
Please post runnable example code to demonstrate this.
>
> The module-description does not help me with that: Is it not good to have
> so many writing ends on a single IO::Pipe
Since IO::Pipe doesn't mention otherwise, I would assume it is not good to
have even 2 writing ends.
> or did I just reach the limit
> for memory (on scriptstart the amount of data grows very fast as the
> children work on old log files, but after a time the father has worked
> off and gets faster than they give more information so the information in
> the pipe at once gets smaller again). I am just too new to perl to have a
> look to the module and see what my problem is. Is there an easy way to
> find that out? Or does anyone already know what might help in this
> information?
>
> I don't think pasting code here helps, as it would be chopped and not
> very helpful anymore.
After you chop it to remove the irrelevant parts, you need to sew it back
up again (and verify it still shows the problem).
> If anyone thinks this might help to understand my
> problem, I will do it anyway :)
>
> Thanks a lot for at least reading so far and thanks for all advises!
You could try "flock"ing the write handle before each write, but I doubt
that will help. I think this problem is much more complicated than you
think it is. Look into IO::Select.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
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 8825
***************************************