[26990] in Perl-Users-Digest
Perl-Users Digest, Issue: 8932 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 8 00:05:58 2006
Date: Tue, 7 Feb 2006 21:05:05 -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, 7 Feb 2006 Volume: 10 Number: 8932
Today's topics:
circular references, chdir() and Term::ReadLine::Gnu? (Jamie)
Re: circular references, chdir() and Term::ReadLine::Gn <1usa@llenroc.ude.invalid>
Re: circular references, chdir() and Term::ReadLine::Gn xhoster@gmail.com
Re: circular references, chdir() and Term::ReadLine::Gn (Jamie)
Re: Keith Keller: Hypocrite <tadmc@augustmail.com>
Re: Keith Keller: Hypocrite <alan@lizella.netWORK>
Re: Keith Keller: Hypocrite <rm@biteme.org>
Re: Keith Keller: Hypocrite <linuce@home>
Re: Keith Keller: Hypocrite <1m@b2i4t5e.org>
Re: Keith Keller: Hypocrite <123@b4567me.org>
Re: Keith Keller: Hypocrite <rm@biteme.org>
Re: Keith Keller: Hypocrite <rm@biteme.org>
Re: Keith Keller: Hypocrite <youmustbejoking@invalid.lan>
Re: Keith Keller: Hypocrite <r2m@b2i2t2eme.org>
Re: perl cgi script buffering? <xlh1200r@pacbell.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 08 Feb 2006 01:09:08 GMT
From: nospam@geniegate.com (Jamie)
Subject: circular references, chdir() and Term::ReadLine::Gnu?
Message-Id: <Lucy1139359538101310xda0b08@localhost>
Hello Again Newsgroup,
A couple days ago, I asked about signal handlers, closures
and circular references. Got some good advice, but the fact
is.. it's an extremely complicated project. (I really would
like to find another way.. this is just too much chasing around)
Is there anything "magical" about the chdir() function that
would cause objects not to destroy properly?
Seems like there shouldn't be, but if I execute the same exact
code without the chdir() things are cleaned up, as soon as
I use chdir():
sub DESTROY {
my($self) = shift;
warn "DESTROY<$self>"; # produces tons of: .... during global destruction
}
Doing a chdir('.') doesn't cause the problem.
It doesn't seem to matter where in the program I use chdir() either.
If I chdir('/tmp') and then chdir back to where I was, things get cleaned
up as normal.
If I run this:
chdir('/tmp');
exit(1);
Same thing, things don't get cleaned up until global destruction time.
This leads me to believe it's an issue with path names stored some place
and linked to the cleanup routines... but, I can't think of a single thing
that would be affected.
Where would I look?
Far as I know, I'm not storing any objects in any way that relates to
the current working directory. (temp files and such, but I've ruled them
out)
I've tried both relative @INC paths and absolute, neither make a difference.
Ever been burned by current working directory during the DESTROY process?
Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
------------------------------
Date: Wed, 08 Feb 2006 01:53:03 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: circular references, chdir() and Term::ReadLine::Gnu?
Message-Id: <Xns9763D4874343Casu1cornelledu@127.0.0.1>
nospam@geniegate.com (Jamie) wrote in
news:Lucy1139359538101310xda0b08@localhost:
> Hello Again Newsgroup,
>
> A couple days ago, I asked about signal handlers, closures
> and circular references. Got some good advice, but the fact
> is.. it's an extremely complicated project. (I really would
> like to find another way.. this is just too much chasing around)
>
> Is there anything "magical" about the chdir() function that
> would cause objects not to destroy properly?
>
> Seems like there shouldn't be, but if I execute the same exact
> code without the chdir() things are cleaned up, as soon as
> I use chdir():
Please post a short but complete program that still exhibits the problem
you are experiencing.
I am not trying to be difficult ... I cannot imagine where one would
even begin to diagnose such an issue without a program that demonstrates
the problem.
You might want to consult the posting guidelines to maximize your
chances 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: 08 Feb 2006 01:50:37 GMT
From: xhoster@gmail.com
Subject: Re: circular references, chdir() and Term::ReadLine::Gnu?
Message-Id: <20060207205312.617$ef@newsreader.com>
nospam@geniegate.com (Jamie) wrote:
> Hello Again Newsgroup,
>
> A couple days ago, I asked about signal handlers, closures
> and circular references. Got some good advice, but the fact
> is.. it's an extremely complicated project. (I really would
> like to find another way.. this is just too much chasing around)
>
> Is there anything "magical" about the chdir() function that
> would cause objects not to destroy properly?
Are using the built-in chdir, or File::chdir?
> Seems like there shouldn't be, but if I execute the same exact
> code without the chdir() things are cleaned up, as soon as
> I use chdir():
>
> sub DESTROY {
> my($self) = shift;
> warn "DESTROY<$self>"; # produces tons of: .... during
> global destruction }
>
> Doing a chdir('.') doesn't cause the problem.
>
> It doesn't seem to matter where in the program I use chdir() either.
I can't reproduce this. Can you produce a minimal program which shows this
effect?
use strict;
{
my $foo = new foo;
my $foo2= new foo;
chdir("/tmp") or die $!;
};
warn "Done";
package foo;
sub new { bless {};};
sub DESTROY {warn("Destroying @_")};
sub whatever {warn "whatever"};
This destroys upon leaving the scope, before the "Done" warning.
>
> If I chdir('/tmp') and then chdir back to where I was, things get cleaned
> up as normal.
>
> If I run this:
>
> chdir('/tmp');
> exit(1);
>
> Same thing, things don't get cleaned up until global destruction time.
Well, with that exit right there, it doesn't much matter--everything is
going to be destroyed right quickly.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Wed, 08 Feb 2006 04:26:27 GMT
From: nospam@geniegate.com (Jamie)
Subject: Re: circular references, chdir() and Term::ReadLine::Gnu?
Message-Id: <Lucy1139371375101900xb98524@localhost>
In: <20060207205312.617$ef@newsreader.com>, xhoster@gmail.com wrote:
>Are using the built-in chdir, or File::chdir?
Built in chdir()
Just found problem though..
>I can't reproduce this. Can you produce a minimal program which shows this
>effect?
During the cleanup, one of the packages was attempting to flush it's
output to a file that didn't exist anymore (due to the new directory)
It died, which threw off all the other cleanup code that was there
to remove the circular references. (There were soo many DESTROY at ...
debug messages I'd completely missed the one that said it couldn't
open the file)
It was buried way deep and I'd forgotten about it.
There has GOT to be.. a good way, something that doesn't involve more
CPAN modules... to deal with this in a more sane fashion.
I remember some time ago reading about a trick using TIESCALAR to
accomplish this, but I can't seem to recall the method.
Experiments thus far (tie using a key in a package %STORE object) don't
seem to be working though. It's as if the variable behind the tie continues
to remain in scope. :-/
I'm trying variations of this:
package Circle;
use strict;
use Carp;
our(%STORE); # Symbolic.
sub TIESCALAR {
my($this,$var) = (shift,shift);
my $key = "" . $var; # Stringification of memory address for %STORE key.
$STORE{$key} = $var;
my $self = bless(\$key,$this);
print "SELF[$self]\n";
return($self);
}
sub FETCH {
my($kref) = shift;
return($STORE{$$kref});
}
sub STORE { croak "Can't store to TIE"; }
sub DESTROY {
my($self) = shift;
my $key = $$self;
my $dl = delete($STORE{$key});
warn "DESTROY: $dl CIRCLE $self ($key)";
}
1;
package main;
circle_three();
sub circle_three {
my($a) = new A('Object A');
my($b) = new B('Object B');
my($ta,$tb);
# A holds a ref to b.
tie $tb, 'Circle', $b;
$a->{b} = $tb;
# B holds a ref to a.
tie $ta, 'Circle', $a;
$b->{a} = $ta;
}
But I still get global destruction on a and b, even though they hold tied variables.
Oddly enough, the Circle objects DO get destroyed after leaving the circle_three()
subroutine.
Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
------------------------------
Date: Tue, 7 Feb 2006 17:03:56 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <slrndui9qs.pks.tadmc@magna.augustmail.com>
[ Followups set ]
R3e4al5to 23ar3ga4rino <1m@b3i4t5eme.org> wrote:
> Keith Keller is a coward
That is rich coming from an anonymous poster.
Use your name if you expect a thinking person to take you seriously.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 07 Feb 2006 18:59:35 -0600
From: +Alan Hicks+ <alan@lizella.netWORK>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <UN6dnYwmNpLq33TenZ2dnUVZ_sSdnZ2d@trueband.net>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
["Followup-To:" header set to alt.os.linux.slackware.]
In alt.os.linux.slackware, A Guy Called Tyketto dared to utter,
> I find it funny. I find you funny. Actually, I find you a
> troll.
I know the posters of AOLS are plenty smart enough to know by now that
arguing with RM isn't going to get anyone anywhere. RM is quite
obviously a very distrubed individual. He doesn't deserve anyone's
hatred or animosity. He deserves your pity if anything. Please quitely
put him in your kill file or ignore him some other way, and move along.
No action you take is going to help him. By lowering yourself to his
level, you're only rubbing shit in your own face.
- --
It is better to hear the rebuke of the wise,
Than for a man to hear the song of fools.
Ecclesiastes 7:5
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)
iD8DBQFD6UKez8zcalmVmBkRAtv6AJ9MEs5TXkcGYyin95fB3vf53LECSwCeJkgz
TI/Pg53/B34OiUgwv5alGJk=
=KsbC
-----END PGP SIGNATURE-----
------------------------------
Date: Wed, 08 Feb 2006 00:59:48 GMT
From: Realto Margarino <rm@biteme.org>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <8obGf.17801$1e5.432442@news20.bellglobal.com>
In comp.lang.perl.misc Dan C <youmustbejoking@invalid.lan> wrote:
> On Tue, 07 Feb 2006 20:24:10 +0000, Realto Margarino wrote:
> > Nonsense. I am certainly the most vociferous in opposition.
> > Others, such as yourself, are cowered.
> Wrong. You're the only one complaining. Can you provide a name
> or message ID of someone else whining about it?
Sure. But not to the likes of a troll like you. Most people in
comp.lang.perl.misc complained about it. I fail to see why the
slackware people would be any different.
cordially, as always,
rm
------------------------------
Date: Wed, 8 Feb 2006 02:17:41 +0100
From: LiNuCe <linuce@home>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <20060208021741.25904847.linuce@home>
Tue, 07 Feb 2006 16:29:01 -0600 - Dan C
<youmustbejoking@invalid.lan> :
> On Tue, 07 Feb 2006 20:24:10 +0000, Realto Margarino wrote:
>
> >> The only one that seems annoyed, is you. Live with it!
>
> > Nonsense. I am certainly the most vociferous in opposition.
> > Others, such as yourself, are cowered.
>
> Wrong. You're the only one complaining. Can you provide a name or
> message ID of someone else whining about it?
>
> Didn't think so. Go to your room, Wanda.
1) As it is possible to put the signature in a attachment to please
everyone, 2) As doing so works with *EVERY* newsreader, 3) As there
is no *GOOD* technical reason to put the GPG signature in plain text
in the message, Candide would say that if everyone puts some good
will and try to be wise to put his/her GPG signature in attachment,
everything is perfect in the most perfect world.
------------------------------
Date: Wed, 08 Feb 2006 01:01:24 GMT
From: RRe45a6o M345a345o <1m@b2i4t5e.org>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <EpbGf.17802$1e5.432901@news20.bellglobal.com>
In comp.lang.perl.misc Dan C <youmustbejoking@invalid.lan> wrote:
> On Tue, 07 Feb 2006 20:51:41 +0000, Realto Margarino wrote:
[trolling deleted]
If we want any from you, we'll give your head a squeeze.
cordially, as always,
rm
------------------------------
Date: Wed, 08 Feb 2006 01:04:05 GMT
From: R4e5a65lto 2M3a4r4g56arino <123@b4567me.org>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <9sbGf.17805$1e5.433096@news20.bellglobal.com>
In comp.lang.perl.misc A Guy Called Tyketto <tyketto@sbcglobal.net.invalid> wrote:
> Simple. I don't want, nor need to. Either way, you're not going
> to stop me from doing what I want.
Tough guy. Nobody tells you what to do.
> PGP goes around the body of the message, as it's a digital
> signature.
So?
> Don't like it, read the RFC, scream, cry, throw your temper
> tantrum, throw your bowl of Corn Flakes on the floor, and stand in
> the corner like the bad little boy you are.
The RFC states that the signature limit is 4 lines. And it doesn't
say anything about calling me any names.
How does calling me names justify including PGP in the body of your
message?
cordially, as always,
rm
------------------------------
Date: Wed, 08 Feb 2006 01:05:17 GMT
From: Realto Margarino <rm@biteme.org>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <htbGf.17806$1e5.433158@news20.bellglobal.com>
In comp.lang.perl.misc Tad McClellan <tadmc@augustmail.com> wrote:
> [ Followups set ]
> R3e4al5to 23ar3ga4rino <1m@b3i4t5eme.org> wrote:
> > Keith Keller is a coward
> That is rich coming from an anonymous poster.
> Use your name if you expect a thinking person to take you seriously.
Sure. My name is Roger Maynard. dranyamlr@hotmail.com.
Everybody in the slackware group knows my name. But I forgot that
none of you do.
cordially, as always,
rm
------------------------------
Date: Wed, 08 Feb 2006 01:27:59 GMT
From: Realto Margarino <rm@biteme.org>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <zObGf.17894$1e5.434886@news20.bellglobal.com>
In alt.os.linux.slackware +Alan Hicks+ <alan@lizella.network> wrote:
pgp trash troll delete
> ["Followup-To:" header set to alt.os.linux.slackware.]
This has been corrected.
> I know the posters of AOLS are plenty smart enough to know by now that
> arguing with RM isn't going to get anyone anywhere. RM is quite
> obviously a very distrubed individual. He doesn't deserve anyone's
> hatred or animosity. He deserves your pity if anything.
Right. You're the biggest troll, and well-known as the biggest
asshole, that posts to this ng. In fact, even you have admitted,
numerous times, that you are this ng's "most hated regulars."
Your inclusion of PGP is a pathetically childish affectation. It is
silly. Nothing you have ever posted to this group required
authentication of any sort.
cordially, as always,
rm
------------------------------
Date: Tue, 07 Feb 2006 20:17:15 -0600
From: Dan C <youmustbejoking@invalid.lan>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <pan.2006.02.08.02.17.15.79163@invalid.lan>
On Wed, 08 Feb 2006 02:17:41 +0100, LiNuCe wrote:
>> Wrong. You're the only one complaining. Can you provide a name or
>> message ID of someone else whining about it?
> 1) As it is possible to put the signature in a attachment to please
> everyone, 2) As doing so works with *EVERY* newsreader, 3) As there
> is no *GOOD* technical reason to put the GPG signature in plain text
> in the message, Candide would say that if everyone puts some good
> will and try to be wise to put his/her GPG signature in attachment,
> everything is perfect in the most perfect world.
This isn't a perfect world.
The problem with that is that attachments don't fly in text newsgroups.
--
If you're not on the edge, you're taking up too much space.
Linux Registered User #327951
------------------------------
Date: Wed, 08 Feb 2006 02:49:49 GMT
From: Re2345alto Ma2222rgarino <r2m@b2i2t2eme.org>
Subject: Re: Keith Keller: Hypocrite
Message-Id: <h%cGf.3067$J%6.196699@news20.bellglobal.com>
In alt.os.linux.slackware Dan C <youmustbejoking@invalid.lan> wrote:
If we want any shit out of you, we'll give your head a squeeze.
cordially, as always,
rm
------------------------------
Date: Wed, 08 Feb 2006 04:58:01 GMT
From: "Jim Isaacson" <xlh1200r@pacbell.net>
Subject: Re: perl cgi script buffering?
Message-Id: <tTeGf.52821$PL5.9907@newssvr11.news.prodigy.com>
Thanks for the info Jim. You were right. On the Linux box I was using
Firefox and on the pc clients it was IE. I loaded Firefox on a pc and the
cgi script loads up right away.
Now I need to see if there is an option or way to kickstart IE.
Thx
Jim
"Jim Gibson" <jgibson@mail.arc.nasa.gov> wrote in message
news:070220061329324796%jgibson@mail.arc.nasa.gov...
> In article <yN7Gf.52680$PL5.31774@newssvr11.news.prodigy.com>, Jim
> Isaacson <golfnow@pacbell.net> wrote:
>
>> Hi
>>
>> I have a html doc that calls a perl cgi script to list or write a scsi
>> tape.
>> If I submit from the html document on the local machine it displays the
>> html
>> in the cgi script and then reads the tape. If I go to any other machine
>> and
>> submit from the html doc it waits until it gets enough data and then
>> displays the html and tape listing ino. It's like its buffering data when
>> not run from the web server? It's driving me crazy and users think the
>> link
>> is broken as it stays on the html page for so long. I've tried using $| =
>> 1
>> and autoflush, it works fine on the local server, just not remotely from
>> any
>> other machines browser.
>
> The way in which an HTML page is displayed is under the control of the
> server and your browser, not the CGI program that generates the page.
> There is little your CGI program can do to influence when the page is
> displayed.
>
> See, for example, the article "Watching long processes through CGI",
> Randal Schwartz, Linux Magazine, Aug 2002:
> <http://www.stonehenge.com/merlyn/LinuxMag/col39.html>
>
>
>>
>> Any help is appreciated, here it the cgi script and it runs on an Apache
>> 2.0.55 server on Redhat linux.
>
> Your program looks like it was written 10 years ago. You should
> consider re-writing it using more modern Perl programming techniques.
> For example, the CGI.pm module has replaced the cgi-lib.pl library, and
> it offers easier-to-use, more flexible and secure features. Adding 'use
> strict' and 'use warnings' to your script will help catch programming
> errors. Perl now has lexical variables, and you don't have to call
> subroutines with & in front of the subroutine name. Perl has "here"
> documents for generating a lot of output. (and there's more).
>
> Good luck.
>
> [perl script snipped]
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com
------------------------------
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 8932
***************************************