[27806] in Perl-Users-Digest
Perl-Users Digest, Issue: 9170 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 18 18:05:52 2006
Date: Tue, 18 Apr 2006 15:05:06 -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 Tue, 18 Apr 2006 Volume: 10 Number: 9170
Today's topics:
Re: help: newbie extracting lines from large file. <tadmc@augustmail.com>
Re: Other XS progamming questions (Anno Siegel)
Re: Other XS progamming questions <nospam-abuse@ilyaz.org>
Re: perl start up - persistent interpreters <sherm@dot-app.org>
Re: REx bug??? /\x99/ compiles.... <nospam-abuse@ilyaz.org>
Re: REx bug??? /\x99/ compiles.... <nospam-abuse@ilyaz.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 18 Apr 2006 16:07:37 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: help: newbie extracting lines from large file.
Message-Id: <slrne4al8p.1up.tadmc@magna.augustmail.com>
Super-User <Super-User@mordor.net> wrote:
> First..... Thank you. I will be looking at what you gave first thing in
> the morning
>
>> What if there are no entries during the midnight hour, so it goes from
>> 11 to 01?
> for past seven years... It has never happened.
So, since you have never been in a car accident in seven years,
you don't wear your seat belts anymore?
> if it does happen then there are serious implications for the business
And one of them will be that this program stops working.
It would be better if you had one less thing to worry about in such
trying times.
An ounce of prevention is worth a pound of cure.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 18 Apr 2006 20:32:48 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Other XS progamming questions
Message-Id: <4al0ngFsi4shU1@news.dfncis.de>
Ferry Bolhar <bol@adv.magwien.gv.at> wrote in comp.lang.perl.misc:
> Anno Siegel:
>
> > > SV *sv1 = newSViv(7);
> > > SV *sv2 = newSVrv(sv1,"myclass");
> > >
> > > sv1 is a reference to the object in sv2, right?
> >
> > No, the other way around. The object proper is the (integer) scalar
> > sv1. sv2 is a reference to sv1, which has been blessed into "myclass".
>
> Hm... have a look at this XS code:
[code snipped, point taken]
> So, as you can see, SV1 is the reference and SV2 is the blessed
> object! SV1 was upgraded from an IV to a PVIV, but is now used
You are right... newSVrv() is a strange beast and had me confused.
Swap sv1 and sv2 in everything I said :)
> as RV only (ROK flag is set, IOK/pIOK flags are cleared). And
> SV2 is a new PVMG wherein the "STASH" slot is used only, the
> MAGIC slot is unused. So SV2 becomes the "blessed object".
...in the sense of "object proper", the data structure a ref to which
is commonly called an object in Perl. It is the object proper, not
because it carries the object data (it doesn't have to), but because
it carries the blessing in its STASH slot.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Tue, 18 Apr 2006 20:39:56 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Other XS progamming questions
Message-Id: <e23iqs$1o0$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Ferry Bolhar
<bol@adv.magwien.gv.at>], who wrote in article <1145354733.539938@proxy.dienste.wien.at>:
> > That's because Perl supports object access only through references. It is
> > quite customary to make the underlying object an anonymous data structure,
> > so that $sv1 as a named variable doesn't exist (or, in the scalar case,
> > doesn't survive object creation). Its name is, in fact, nowhere needed,
> > but its existence as an SV is essential.
>
> But I cant't understand why I _must_ use a RV to access SV used as
> object. It's OK that I _can_ do so, but why the need? Just syntactical
> reasons? Or are there implementation needs as well?
Think of semantic of $a = $b with $b an object. See also
L<overload/"Metaphor clash">.
Hope this helps,
Ilya
------------------------------
Date: Tue, 18 Apr 2006 15:52:56 -0400
From: Sherm Pendley <sherm@dot-app.org>
Subject: Re: perl start up - persistent interpreters
Message-Id: <m27j5mbqzr.fsf@Sherm-Pendleys-Computer.local>
bugbear <bugbear@trim_papermule.co.uk_trim> writes:
> I have an application where I would
> very much like this benefit of reduced
> perl startup time, but don't want Apache;
> my application does does not involve
> outputting HTML.
>
> Are there any (other) persistent perl
> interpreters out there?
Maybe so, but I don't see how that could possibly be relevant to adding an
embedded interpreter to your own app.
Have a look at:
perldoc perlembed
perldoc perlapi
perldoc perlguts
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Tue, 18 Apr 2006 20:25:33 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: REx bug??? /\x99/ compiles....
Message-Id: <e23hvt$1hk$1@agate.berkeley.edu>
[A complimentary Cc of this posting was NOT [per weedlist] sent to
Dr.Ruud
<rvtol+news@isolution.nl>], who wrote in article <e22mum.1gk.1@news.isolution.nl>:
> > One can easily check that /\99/ is equivalent to /\000(?:99)/.
> With plenty of capture groups, \99 gets a different meaning:
> $ perl -le '$r="(.)"x100; $_=")"x102; s/$r\99/:/; print'
> :)
Hmm... And how would one enter octals if one has 377 groups? Well,
one could enter \566 instead of \166:
>perl -Mre=debug -wle "/\566/"
Freeing REx: `","'
Compiling REx `\566'
size 3 Got 28 bytes for offset annotations.
first at 1
1: EXACT <v>(3)
3: END(0)
anchored `v' at 0 (checking anchored isall) minlen 1
Offsets: [3]
1[3] 0[0] 5[0]
Use of uninitialized value in pattern match (m//) at -e line 1.
Freeing REx: `"\\566"'
but this is hardly a beautiful solution...
Yours,
Ilya
------------------------------
Date: Tue, 18 Apr 2006 20:29:52 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: REx bug??? /\x99/ compiles....
Message-Id: <e23i80$1id$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de>], who wrote in article <4ajv7dFtbsccU1@news.dfncis.de>:
> > One can easily check that /\99/ is equivalent to /\000(?:99)/. A
> > warning is emitted, but the interpretation is, IMO, OBVIOUSLY not one
> > intended by the user.
> Another question is why the warning appears twice.
This is easy. There are two "practically identical" passes over a REx
during compile; one to gather "global" information, another to
actually emit the tree; done by the same code (with one bit of state
changed). It would take too much effort to separate stuff where a
warning makes sense during one pass only from those which would be
triggered on both.
Hope this helps,
Ilya
------------------------------
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 9170
***************************************