[26381] in Perl-Users-Digest
Perl-Users Digest, Issue: 8553 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 22 00:06:04 2005
Date: Fri, 21 Oct 2005 21:05:04 -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 Fri, 21 Oct 2005 Volume: 10 Number: 8553
Today's topics:
Re: ActivePerl 5.8.7 crashes <sisyphus1@nomail.afraid.org>
Re: How to pass lock to the parent process? <1usa@llenroc.ude.invalid>
Re: How to pass lock to the parent process? <h.b.furuseth@usit.uio.no>
Re: How to pass lock to the parent process? xhoster@gmail.com
Re: Microsoft Hatred FAQ <my_email_is_posted_on_my_website@munged.invalid>
Re: why the perl docs suck <Fred@fred.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 22 Oct 2005 04:57:37 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: ActivePerl 5.8.7 crashes
Message-Id: <43593a69$0$15219$afc38c87@news.optusnet.com.au>
"Dave" <daveandniki@ntlworld.com> wrote in message
> >
> > Do you really need to binmode STDIN ?
> > If you haven't already, carefully check the 'perldoc -f binmode' and
> > 'perldoc -f open' documentation for some ideas that might enable you to
> > fix
> > the problem.
>
> Prior to using XML::Parser I was using regular expressions to parse the
XML
> file. In that case the binmode was necessary or the utf-8 was read in as
> bytes.
I was thinking that perhaps you could use open() to establish ":utf8" as the
default I/O layer, rather than binmode().
Cheers,
Rob
------------------------------
Date: Fri, 21 Oct 2005 18:34:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to pass lock to the parent process?
Message-Id: <Xns96F6943BDDD3asu1cornelledu@127.0.0.1>
Hallvard B Furuseth <h.b.furuseth@usit.uio.no> wrote in
news:hbf.20051021ha5t@bombur.uio.no:
> I wrote:
>>xhoster@gmail.com writes:
>>>Hallvard B Furuseth <h.b.furuseth@usit.uio.no> wrote:
>>>> I need a to pass a file lock to the parent process - and
>>>> to detect that this works.
>>>
>>> Why? If the parent needs the lock, why not have the parent lock it?
>>
>> Well, that's another way. But there are several children. Each
>> should start processing as soon as its lock can be acquired. (...)
>
> Oops, that was a fine example of a too-late-night posting:-)
>
> The other half of the answer is that the client first does some work,
> and after that it may need the lock for some more work. After that it
> may need to ask the parent to take over.
Honestly, I would like to take a stab at answering this question, but
you make it unnecessarily hard to help you by not providing concrete
information.
Please post a short but complete script illustrating what you want to
do, and explain how it does not do what you want to do. The posting
guidelines explain how to compose a message that will give you the
greatest chance of getting a useful response.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and
remove .invalid for email address)
comp.lang.perl.misc guidelines on
the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Fri, 21 Oct 2005 20:41:23 +0200
From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
Subject: Re: How to pass lock to the parent process?
Message-Id: <hbf.20051021dv3x@bombur.uio.no>
xhoster@gmail.com writes:
> Hallvard B Furuseth <h.b.furuseth@usit.uio.no> wrote:
>> I need a to pass a file lock to the parent process - and
>> to detect that this works.
>>
>> The best answer would be passing a file descriptor through a socket,
>> but I couldn't find how to do that with Perl.
>
> Have you looked at File::FDpasser?
Perfect! Thanks!
>> Another way is to open() the file in the parent and flock() it in the
>> child - that works on my host, but I don't know how to test reliably if
>> it works. Perl can use either the C system call flock(), lockf() or
>> fcntl() for file locks, and I don't even know if it is reliable for the
>> flock() system call.
>
> I'm not confident that any method is gauranteed to work across all
> these variations. Is your goal to have something that works for your
> system, and it would be nice if it is portable?
Yes. And to make sure, it must reliably return an error when it doesn't
work. The problem which needs these locks will likey be obsolete by the
time I need to do any porting. (So the hack I posted at first would
also be OK, if I knew how to ask Perl if it works.)
--
Hallvard
------------------------------
Date: 21 Oct 2005 19:58:51 GMT
From: xhoster@gmail.com
Subject: Re: How to pass lock to the parent process?
Message-Id: <20051021155851.543$Bm@newsreader.com>
Hallvard B Furuseth <h.b.furuseth@usit.uio.no> wrote:
> xhoster@gmail.com writes:
> > Hallvard B Furuseth <h.b.furuseth@usit.uio.no> wrote:
> >> I need a to pass a file lock to the parent process - and
> >> to detect that this works.
> >>
> >> The best answer would be passing a file descriptor through a socket,
> >> but I couldn't find how to do that with Perl.
> >
> > Have you looked at File::FDpasser?
>
> Perfect! Thanks!
>
> >> Another way is to open() the file in the parent and flock() it in the
> >> child - that works on my host, but I don't know how to test reliably
> >> if it works. Perl can use either the C system call flock(), lockf()
> >> or fcntl() for file locks, and I don't even know if it is reliable for
> >> the flock() system call.
> >
> > I'm not confident that any method is gauranteed to work across all
> > these variations. Is your goal to have something that works for your
> > system, and it would be nice if it is portable?
>
> Yes. And to make sure, it must reliably return an error when it doesn't
> work. The problem which needs these locks will likey be obsolete by the
> time I need to do any porting. (So the hack I posted at first would
> also be OK, if I knew how to ask Perl if it works.)
I'm not sure what you mean by "works". If the child fails to obtain the
lock, it should die or do something else such that $? in the parent is not
zero.
If you need to know if the lock on a forked fh (by the child) survives in
the parent after the child's demise, do a test to determine that. This is
a property of the system, not of a race condition or something. So if it
works on your system, it works. You don't need to test it each time you
run the program, only each time you make major changes to your system.
perl -le 'fork; open $fh, ">foo" or die $!; fork or do {flock $fh,2 or die
$!;\ warn "$$ Got lock"; exit}; sleep 20; warn "$$ releasing lock"'
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Sat, 22 Oct 2005 01:07:29 GMT
From: Roedy Green <my_email_is_posted_on_my_website@munged.invalid>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <q54jl1t5j1leo5brfkbm58riiejqdf250m@4ax.com>
On Thu, 20 Oct 2005 22:07:51 GMT, "Mike Schilling"
<mscottschilling@hotmail.com> wrote or quoted :
>his status
>as employee gives him no additional rights or responsibilities in this
>respect.
It may not be so in law, but I think most moral codes put more onus on
the employee than the average citizen.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
------------------------------
Date: Fri, 21 Oct 2005 18:38:16 -0500
From: "Fred@fred.net" <Fred@fred.net>
Subject: Re: why the perl docs suck
Message-Id: <uqsil1lof0cevvt7m5fvtn4488uu6bpq27@4ax.com>
On 21 Oct 2005 11:53:56 GMT, Robert Sedlacek <phaylon@dunkelheit.at>
wrote:
>Fred@fred.net <Fred@fred.net> wrote
>
>> Ah, an educated man. He said that after, much later and after, the
>> original writing.
>
>I have the book at home, two times, including original hand-writing and
>studied this terms for years. You may believe in what you like, but you
>got Thelema a bit wrong.
>
>93/93,
>p
Good wishes to you. Sounds like you have some really cool stuff. I
myself have only studied the topic a little. I read "The Golden Bough"
and that's what got me interested in the topic from a sociological
standpoint, and in my case that masked a personal one.
But I would never tell someone they got something wrong, I would only
say that I understood it differently.
That might lead to a nice discussion, but I myself will allow this is
off topic even for me on c.l.p.m , but , I'm not begging off.
If you would like to arrange for private email, I'd be agreeable.
Peace.
Fred
------------------------------
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 8553
***************************************