[31768] in Perl-Users-Digest
Perl-Users Digest, Issue: 3031 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 16 16:10:08 2010
Date: Fri, 16 Jul 2010 13:09:48 -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, 16 Jul 2010 Volume: 11 Number: 3031
Today's topics:
Re: [OT?] kid's output stuck in a TTY?! <nospam-abuse@ilyaz.org>
Re: [OT?] kid's output stuck in a TTY?! <ben@morrow.me.uk>
Re: [OT?] kid's output stuck in a TTY?! <nospam-abuse@ilyaz.org>
Re: CGI Program Questions <lifefeed@gmail.com>
Re: CGI Program Questions (hymie!)
Re: CGI Program Questions noone@earthlink.net
Re: CGI Program Questions <edgrsprj@ix.netcom.com>
Re: CGI Program Questions <edgrsprj@ix.netcom.com>
Re: CGI Program Questions <edgrsprj@ix.netcom.com>
Re: CGI Program Questions <edgrsprj@ix.netcom.com>
Re: CGI Program Questions <justin.1007@purestblue.com>
debugging Carp <marc.girod@gmail.com>
Re: debugging Carp <ben@morrow.me.uk>
Re: debugging Carp <derykus@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 13 Jul 2010 21:20:59 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: [OT?] kid's output stuck in a TTY?!
Message-Id: <slrni3pm5r.2kv.nospam-abuse@powdermilk.math.berkeley.edu>
On 2010-07-13, Ben Morrow <ben@morrow.me.uk> wrote:
> Quoth Peter Makholm <peter@makholm.net>:
>> So the child process is doing something like
>>
>> open my $fh, ">", "/dev/tty";
>>
>> ?
Yes.
> Closing a piped-open filehandle will wait for the child, so once close
> has returned the child will have exitted. (This may of course take some
> time if the child isn't killed by SIGPIPE.)
The kid just runs off the end of the script. Hmm, another thing I
missed in my description: kid writes 3 bytes to its end of the pipe
(STDOUT), and parent reads it all before close()ing.
> It's not what I see here, at least with a simple test. If I run
>
> my $K;
> unless (open $K, "-|") {
> warn "kid: $$";
> open my $T, ">", "/dev/tty";
> print $T "one two three\n";
> sleep 4;
> print $T "four five six\n";
> exit 22;
> }
> close $K;
> warn +($?>>8) . ": seven eight nine";
>
> I consistently get the parent waiting for the child to finish before
> continuing. Ilya: can you try that code, to see if you see the same
> behaviour?
Looks normal:
kid: 2743 at ./foo.pl line 3.
one two three
four five six
22: seven eight nine at ./foo.pl line 11.
======
I put the script to
ilyaz.org/software/tmp/run_redir.pl
I run it as
perl ./run_redir.pl 1 > ! nu
perl ./run_redir.pl > ! nu
The version with 1 sleep()s, and "--"-delimited groups have duplicated
output (as expected). Without `1', "--"-delimited groups are
different, which I interpret as "--" being written at wrong order...
Puzzled,
Ilya
------------------------------
Date: Tue, 13 Jul 2010 22:45:33 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: [OT?] kid's output stuck in a TTY?!
Message-Id: <tc3vg7-bg13.ln1@osiris.mauzo.dyndns.org>
Quoth Ilya Zakharevich <nospam-abuse@ilyaz.org>:
> On 2010-07-13, Ben Morrow <ben@morrow.me.uk> wrote:
>
> > Closing a piped-open filehandle will wait for the child, so once close
> > has returned the child will have exitted. (This may of course take some
> > time if the child isn't killed by SIGPIPE.)
>
> The kid just runs off the end of the script. Hmm, another thing I
> missed in my description: kid writes 3 bytes to its end of the pipe
> (STDOUT), and parent reads it all before close()ing.
Another thing you missed: you are forking twice (a child of a child).
AFAICT (I can't follow exactly what it's supposed to be doing)
explicitly closing P in the child (which is the handle to the pipe to
the grandchild) appears to fix the problem. Certainly, it stops any
output from appearing after the (grand-)parent has exitted.
Ben
------------------------------
Date: Wed, 14 Jul 2010 04:44:46 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: [OT?] kid's output stuck in a TTY?!
Message-Id: <slrni3qg5u.3nu.nospam-abuse@powdermilk.math.berkeley.edu>
On 2010-07-13, Ben Morrow <ben@morrow.me.uk> wrote:
>
> Quoth Ilya Zakharevich <nospam-abuse@ilyaz.org>:
>> On 2010-07-13, Ben Morrow <ben@morrow.me.uk> wrote:
>>
>> > Closing a piped-open filehandle will wait for the child, so once close
>> > has returned the child will have exitted. (This may of course take some
>> > time if the child isn't killed by SIGPIPE.)
>>
>> The kid just runs off the end of the script. Hmm, another thing I
>> missed in my description: kid writes 3 bytes to its end of the pipe
>> (STDOUT), and parent reads it all before close()ing.
>
> Another thing you missed: you are forking twice (a child of a child).
Good idea! So it is the grandchild which writes to TTY, while may
implicit wait() waits for the child! No wonder that grandchild has
not yet terminate when the child does...
A lot of thanks...
> AFAICT (I can't follow exactly what it's supposed to be doing)
Ha! It is just an initial prototype of a framework to test running
Perl with some of STDIN/etc closed. To make it real, I'm afraid I
need yet another parent/child layer on top of this...
Yours,
Ilya
------------------------------
Date: Tue, 13 Jul 2010 13:10:31 -0700 (PDT)
From: Justin M <lifefeed@gmail.com>
Subject: Re: CGI Program Questions
Message-Id: <0d6b92d5-6b48-45d4-a4ec-34e84e602327@w12g2000yqj.googlegroups.com>
On Jul 12, 8:43=A0pm, "E.D.G." <edgrs...@ix.netcom.com> wrote:
> --- =A0A "Science Module" for Perl. =A0A single module would contain all =
of the
> math, graphics, and CGI features etc. that science researchers need for
> their work.
This could be built similarly to Modern::Perl.
http://search.cpan.org/~chromatic/Modern-Perl-1.03/lib/Modern/Perl.pm
--
Justin McGuire
Perl Firefighter
------------------------------
Date: Wed, 14 Jul 2010 13:02:53 GMT
From: hymie@lactose.homelinux.net (hymie!)
Subject: Re: CGI Program Questions
Message-Id: <1Ai%n.3013$o27.2845@newsfe08.iad>
In our last episode, the evil Dr. Lacto had captured our hero,
"E.D.G." <edgrsprj@ix.netcom.com>, who said:
>--- A "Science Module" for Perl. A single module would contain all of the
>math, graphics, and CGI features etc. that science researchers need for
>their work.
So you think that
* All "science researchers" use the exact same set of tools?
* No other person would possibly use any of those tools?
--hymie! http://lactose.homelinux.net/~hymie hymie@lactose.homelinux.net
-------------------------------------------------------------------------------
------------------------------
Date: Wed, 14 Jul 2010 08:04:26 -0700
From: noone@earthlink.net
Subject: Re: CGI Program Questions
Message-Id: <fdkr361c95ft6s8jhldblmaihhpfigln2r@4ax.com>
hymie! wrote:
>In our last episode, the evil Dr. Lacto had captured our hero,
> "E.D.G." <edgrsprj@ix.netcom.com>, who said:
>
>>--- A "Science Module" for Perl. A single module would contain all of the
>>math, graphics, and CGI features etc. that science researchers need for
>>their work.
>
>So you think that
>
>* All "science researchers" use the exact same set of tools?
>* No other person would possibly use any of those tools?
>
Probably the stoopidest answer that could have given. Idiot.
------------------------------
Date: Wed, 14 Jul 2010 10:40:42 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: CGI Program Questions
Message-Id: <v5GdndBjYpDkR6DRnZ2dnUVZ_o-dnZ2d@earthlink.com>
"Justin M" <lifefeed@gmail.com> wrote in message
news:0d6b92d5-6b48-45d4-a4ec-34e84e602327@w12g2000yqj.googlegroups.com...
This was just an introductory mention of this general subject. It will
probably be discussed again in the future as more features are added to a
Web site that is being developing.
------------------------------
Date: Wed, 14 Jul 2010 10:41:15 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: CGI Program Questions
Message-Id: <DoadnQJgA5IGR6DRnZ2dnUVZ_vCdnZ2d@earthlink.com>
"hymie!" <hymie@lactose.homelinux.net> wrote in message
news:1Ai%n.3013$o27.2845@newsfe08.iad...
This was just an introductory mention of this general subject. It will
probably be discussed again in the future as more features are added to a
Web site that is being developing.
------------------------------
Date: Wed, 14 Jul 2010 10:52:33 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: CGI Program Questions
Message-Id: <pYSdnddjJJfdQKDRnZ2dnUVZ_oednZ2d@earthlink.com>
"Derek.Moody" <derek.moody@clara.net> wrote in message
news:ant1314350b0BxcK@strongarm.half-baked-idea.co.uk...
The comments that people made in their responses were actually
carefully considered. And I know the difference between E-mail and Web site
programs.
At the moment this effort is still in progress. Some technical
matters regarding the Web site operations still need to be settled. After
everything is running I will try to post another note summarizing things.
Other people might be interested in this type of application.
------------------------------
Date: Wed, 14 Jul 2010 11:13:39 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: CGI Program Questions
Message-Id: <z7CdnVFwUaquf6DRnZ2dnUVZ_q2dnZ2d@earthlink.com>
"RedGrittyBrick" <RedGrittyBrick@SpamWeary.invalid> wrote in message
news:VPadnW1SH_k2XaHRnZ2dnUVZ8iqdnZ2d@bt.com...
My response to your first posting did not say this, but, thanks for
the helpful comments that you made.
The basic question that had to be answered pertained to whether or
not it would be possible to do certain things in connection with a Web site
that I have on a particular Web server. E-mail can be sent to addresses
associated with my domain name hosted by that server. Many Web site
packages offer a service like that. But I did not know if anything could be
done with those E-mails other than forward them to some other E-mail
address.
My original inquires regarding that submitted to Web server personnel
got a “No” answer. But fortunately, someone who is familiar with that
server’s capabilities responded that it could actually be done using a
“pipe” contained within the Web server’s standard mail forwarding program.
Present efforts involve creating a Web site program to receive and
process those “piped” E-mails. And once that is running the code will if
possible be merged into a Perl language bulletin board program that will run
at the site.
When everything is operational I plan to post another note here
providing some details regarding what needed to be done to get things
running. Other people might be interested in that type of application.
------------------------------
Date: Thu, 15 Jul 2010 14:46:07 +0100
From: Justin C <justin.1007@purestblue.com>
Subject: Re: CGI Program Questions
Message-Id: <v1g3h7-n97.ln1@zem.masonsmusic.co.uk>
On 2010-07-14, E.D.G. <edgrsprj@ix.netcom.com> wrote:
> "hymie!" <hymie@lactose.homelinux.net> wrote in message
> news:1Ai%n.3013$o27.2845@newsfe08.iad...
>
> This was just an introductory mention of this general subject. It will
> probably be discussed again in the future as more features are added to a
> Web site that is being developing.
Please quote appropriately, without quoting context is lost.
Justin.
------------------------------
Date: Fri, 16 Jul 2010 08:07:28 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: debugging Carp
Message-Id: <5cb61673-595b-4496-a407-033a3f702493@d8g2000yqf.googlegroups.com>
Hi,
Debugging some problems I had (with map), I got extra errors under the
debugger, while trying to step around calls to warn:
Bizarre copy of ARRAY in sassign at /usr/lib/perl5/5.10/Carp/Heavy.pm
line 104, <GEN1> line 1.
Carp::caller_info(/usr/lib/perl5/5.10/Carp/Heavy.pm:104):
104: my $arg = shift;
DB<10> x @_
Bizarre copy of ARRAY in leaveeval at /usr/lib/perl5/5.10/perl5db.pl
line 638, <GEN1> line 1.
The first occurrence was still under my using 'map'.
I see that Carp itself uses a DB package.
Can there be that it conflicts with the debugger?
The second occurrence happened after I had switched my using map for
grep, and got the expected behaviour without the debugger.
I couldn't narrow the problem down yet.
Thanks,
Marc
------------------------------
Date: Fri, 16 Jul 2010 18:10:51 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: debugging Carp
Message-Id: <rdg6h7-3ub1.ln1@osiris.mauzo.dyndns.org>
Quoth Marc Girod <marc.girod@gmail.com>:
>
> Debugging some problems I had (with map), I got extra errors under the
> debugger, while trying to step around calls to warn:
>
> Bizarre copy of ARRAY in sassign at /usr/lib/perl5/5.10/Carp/Heavy.pm
> line 104, <GEN1> line 1.
>
> Carp::caller_info(/usr/lib/perl5/5.10/Carp/Heavy.pm:104):
> 104: my $arg = shift;
> DB<10> x @_
> Bizarre copy of ARRAY in leaveeval at /usr/lib/perl5/5.10/perl5db.pl
> line 638, <GEN1> line 1.
This is a bug in perl, or in the debugger. I'm not terribly surprised:
@_ is deeply weird (especially when you've 'shift'ed it), and the
debugger is deeply weird; mix the two and presto! you get bugs :(. (Carp
uses some of the debugger hooks internally, so it's not surprising it
hits some of the same bugs.)
If you need a solution you could try upgrading to 5.12.1, to see if it's
been fixed; you could also try searching http://rt.perl.org/rt3/Public/
for a known bug. It may be worth reporting a new bug if you don't find
one that matches, especially if you've got a really simple testcase.
http://rt.perl.org/rt3/Public/Bug/Display.html?id=52610 looks like your
Carp error; it is unfixed, and appears to fall into the general category
of 'perl's stack isn't refcounted' bugs, which are unfortunately more
common that they should be and extremely difficult to fix (without
breaking half the XS in existence).
Ben
------------------------------
Date: Fri, 16 Jul 2010 11:09:51 -0700 (PDT)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: debugging Carp
Message-Id: <a14b324b-ea2a-444a-a3b7-241fd490b469@x20g2000pro.googlegroups.com>
On Jul 16, 10:10=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Marc Girod <marc.gi...@gmail.com>:
>
>
>
> > Debugging some problems I had (with map), I got extra errors under the
> > debugger, while trying to step around calls to warn:
>
> > Bizarre copy of ARRAY in sassign at /usr/lib/perl5/5.10/Carp/Heavy.pm
> > line 104, <GEN1> line 1.
>
> > Carp::caller_info(/usr/lib/perl5/5.10/Carp/Heavy.pm:104):
> > 104: =A0 =A0 =A0 =A0 my $arg =3D shift;
> > =A0 DB<10> x @_
> > Bizarre copy of ARRAY in leaveeval at /usr/lib/perl5/5.10/perl5db.pl
> > line 638, <GEN1> line 1.
>
> This is a bug in perl, or in the debugger. I'm not terribly surprised:
> @_ is deeply weird (especially when you've 'shift'ed it), and the
> debugger is deeply weird; mix the two and presto! you get bugs :(. (Carp
> uses some of the debugger hooks internally, so it's not surprising it
> hits some of the same bugs.)
>
> If you need a solution you could try upgrading to 5.12.1, to see if it's
> been fixed; you could also try searchinghttp://rt.perl.org/rt3/Public/
> for a known bug. It may be worth reporting a new bug if you don't find
> one that matches, especially if you've got a really simple testcase.
>
> http://rt.perl.org/rt3/Public/Bug/Display.html?id=3D52610looks like your
> Carp error; it is unfixed, and appears to fall into the general category
> of 'perl's stack isn't refcounted' bugs, which are unfortunately more
> common that they should be and extremely difficult to fix (without
> breaking half the XS in existence).
A google P5P thread cites this example below.
Pending a fix, a workaround should be possible
in some cases:
use diagnostics;
my @x =3D 1 .. 10;
sub s1 {
@x =3D (); # don't do this now!
my $x =3D qr/a/;
for (@_) {
s2($_);
}
}
sub s2 {
my $y =3D shift; # error here
print $y;
}
s1(@x);
__END__
(P) Perl detected an attempt to copy an internal value that
is not copyable.
Bizarre copy of ARRAY in sassign ...
--
Charles DeRykus
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 V11 Issue 3031
***************************************