[26357] in Perl-Users-Digest
Perl-Users Digest, Issue: 8530 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 17 00:05:33 2005
Date: Sun, 16 Oct 2005 21:05:05 -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 Sun, 16 Oct 2005 Volume: 10 Number: 8530
Today's topics:
Re: core dump after alarm goes off xhoster@gmail.com
Re: Hash of array access tricks. Sorry, long. <lawrence@hummer.not-here.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Oct 2005 22:42:53 GMT
From: xhoster@gmail.com
Subject: Re: core dump after alarm goes off
Message-Id: <20051016184253.593$8U@newsreader.com>
colonel@monmouth.com (The Pied Typer) wrote:
> I have several related memory- and output-intensive Perl programs.
> They all have a timeout option that uses the alarm function. The ALRM
> handler goes into a temporary directory, unlinks all the files, removes
> the directory, and exits.
>
> These programs very often dump core after running the handler.
What version of Perl?
perlipc:
Prior to Perl 5.7.3 it was necessary to do as little as you possibly
could in your handler; notice how all we do is set a global variable
and then raise an exception. That's because on most systems,
libraries are not re-entrant; particularly, memory allocation and
I/O routines are not. That meant that doing nearly anything in your
handler could in theory trigger a memory fault and subsequent core
dump - see "Deferred Signals" below.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 16 Oct 2005 17:29:13 -0700
From: Lawrence Statton N1GAK/XE2 <lawrence@hummer.not-here.net>
Subject: Re: Hash of array access tricks. Sorry, long.
Message-Id: <x7ek6lrnom.fsf@hummer.i-did-not-set--mail-host-address--so-shoot-me>
"s. keeling" <keeling@spots.ab.ca> writes:
> Lawrence Statton N1GAK/XE2 <lawrence@hummer.not-here.net>:
> > "s. keeling" <keeling@spots.ab.ca> writes:
> >
> > > s. keeling <keeling@spots.ab.ca>:
> > > > I've built a HoA as so:
> > > >
> > > > my %prompt = (
> > > > FIRST_NAME => [ qq(NULL), qq(NULL), qq(\tFirst name -> ),
> > > > qq(You MUST supply a first name.\n) ],
> > > > LAST_NAME => [ qq(NULL), qq(NULL), qq(\tLast name -> ),
> > > > qq(You MUST supply a last name.\n) ],
> > > >
> > > > and so on. I'd like to write to and access $prompt->{$key}[2] when
> > > > prompting a user for the name, and I'd like to stuff the reply in
> > > > $prompt{$key}[1], then compare that with $prompt->{$key}[0], which
> > > > I'll try to supply via a call to mysql. :-)
> > >
> > > I should also say for some reason it won't work if I don't declare
> > > both $prompt and %prompt, ... or should I just be "my"ing the former
> >
> > perhaps this will help you understand...
> >
> > #!/usr/bin/perl
>
> Well,it adds to the mystery.
>
> > %prompt at $prompt are different variables.... Just WISHING $prompt
> > to become a refrence to %prompt will not make it so.
>
> It seems my books disagreed, as I understood them. Now I see a
> construct I hadn't seen necessary 'til now: @{$prompt->{$key}[2]}. Thx.
>
Okay, drawing a picture
%promt = ( this => [ qw / one two three / ] ,
that => [ qw / four five six / ] );
There is *NO SUCH THING* as $prompt->{this}
There is *NO SUCH THING* as $prompt->{this}[2]
There *IS* $prompt{this}
There *IS* a value for $prompt{this}[2]
What you have had explained several times and failed to understand
$prompt{$k} is not the same as $prompt->{$k}
One is an element of a hash; the other is an element of a hashref.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer software consists of only two components: ones and
zeros, in roughly equal proportions. All that is required is to
sort them into the correct order.
------------------------------
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 8530
***************************************