[32861] in Perl-Users-Digest
Perl-Users Digest, Issue: 4127 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 30 05:17:36 2014
Date: Thu, 30 Jan 2014 02:17:04 -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 Thu, 30 Jan 2014 Volume: 11 Number: 4127
Today's topics:
blessed coderefs <rweikusat@mobileactivedefense.com>
Re: blessed coderefs <ben@morrow.me.uk>
Re: blessed coderefs <rweikusat@mobileactivedefense.com>
Re: blessed coderefs <adrien.barreau@live.fr>
Re: blessed coderefs <ben@morrow.me.uk>
Re: creating a custom newsreader <*@eli.users.panix.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 28 Jan 2014 23:15:50 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: blessed coderefs
Message-Id: <87ob2vy9y1.fsf@sable.mobileactivedefense.com>
I've just encountered the first situation where the 'obvious solution'
involves a blessed code references: I have a subsystem returning a
closure which returns the names of PNG-files depicting QR-codes while
creating the files as a side effect. I'd like to use a dedicated process
for actual PNG generation so that this can be done in parallell with
'other activities' of the same program. The ultimate output of this code
is a PDF document containing the QR-code images, hence, it is necessary
to wait until this coprocess has finished its work before generating the
PDF. The simple solution to this seems to be to bless the returned coderef
into a package whose DESTROY method waits for the corprocess.
As soon as this is implemented, I will have used all kinds of 'ordinary
references' available in Perl as objects at one point or another.
------------------------------
Date: Wed, 29 Jan 2014 01:09:15 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: blessed coderefs
Message-Id: <ru0mra-tlb.ln1@anubis.morrow.me.uk>
Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
> I've just encountered the first situation where the 'obvious solution'
> involves a blessed code references: I have a subsystem returning a
> closure which returns the names of PNG-files depicting QR-codes while
> creating the files as a side effect. I'd like to use a dedicated process
> for actual PNG generation so that this can be done in parallell with
> 'other activities' of the same program. The ultimate output of this code
> is a PDF document containing the QR-code images, hence, it is necessary
> to wait until this coprocess has finished its work before generating the
> PDF. The simple solution to this seems to be to bless the returned coderef
> into a package whose DESTROY method waits for the corprocess.
>
> As soon as this is implemented, I will have used all kinds of 'ordinary
> references' available in Perl as objects at one point or another.
IO? FORMAT? REGEXP? VSTRING? LVALUE? REF?
Ooh, there seems to be a new one: INVLIST. I've no idea what a one of
those is... seems to be something to do with regexen and Unicode ranges.
Ben
------------------------------
Date: Wed, 29 Jan 2014 15:21:52 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: blessed coderefs
Message-Id: <874n4m24q7.fsf@sable.mobileactivedefense.com>
Ben Morrow <ben@morrow.me.uk> writes:
> Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
>> I've just encountered the first situation where the 'obvious solution'
>> involves a blessed code references: I have a subsystem returning a
>> closure which returns the names of PNG-files depicting QR-codes while
>> creating the files as a side effect. I'd like to use a dedicated process
>> for actual PNG generation so that this can be done in parallell with
>> 'other activities' of the same program. The ultimate output of this code
>> is a PDF document containing the QR-code images, hence, it is necessary
>> to wait until this coprocess has finished its work before generating the
>> PDF. The simple solution to this seems to be to bless the returned coderef
>> into a package whose DESTROY method waits for the corprocess.
>>
>> As soon as this is implemented, I will have used all kinds of 'ordinary
>> references' available in Perl as objects at one point or another.
>
> IO? FORMAT? REGEXP? VSTRING? LVALUE? REF?
I'm using Linux queued realtime signals for I/O notification in one
program and the 'internal API' uses filehandles (glob references)
blessed into a package/ class whose methods interact with the 'I/O
notification subsystem' and enable/ disable O_ASYNC for the filehandle
in question as desired which is 'sort of' an IO object. I also once
accidentally caught a wild LVALUE and inspected it out of botancial
curiosity[*] but I haven't found a use for these yet. Admittedly, I didn't
use REF references (reference to a reference) as objects so far,
either. I've never used formats for anything and I don't even know how
to create a VSTRING reference.
[*]
my $text = 'the day after';
my $lv = \substr($text, 4, 3);
print("$lv\n");
$$lv = 'month';
print("$text\n");
------------------------------
Date: Wed, 29 Jan 2014 17:45:24 +0100
From: Adrien BARREAU <adrien.barreau@live.fr>
Subject: Re: blessed coderefs
Message-Id: <lcbb74$ks8$1@dont-email.me>
On 01/29/2014 04:21 PM, Rainer Weikusat wrote:
> either. I've never used formats for anything and I don't even know how
> to create a VSTRING reference.
>
$ perl -e 'print ref \65.66.67'
VSTRING
Here is one.
Adrien.
------------------------------
Date: Wed, 29 Jan 2014 17:18:53 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: blessed coderefs
Message-Id: <topnra-m6v.ln1@anubis.morrow.me.uk>
Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
> Ben Morrow <ben@morrow.me.uk> writes:
> > Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
> >>
> >> As soon as this is implemented, I will have used all kinds of 'ordinary
> >> references' available in Perl as objects at one point or another.
> >
> > IO? FORMAT? REGEXP? VSTRING? LVALUE? REF?
>
> I'm using Linux queued realtime signals for I/O notification in one
> program and the 'internal API' uses filehandles (glob references)
> blessed into a package/ class whose methods interact with the 'I/O
> notification subsystem' and enable/ disable O_ASYNC for the filehandle
> in question as desired which is 'sort of' an IO object.
Oh no, that doesn't count :). I have actually used a bare IO (the thing
you get a reference to if you say *fh{IO} or Symbol::geniosym) as an
object in the past; when you don't need any other properties (or you're
doing them inside-out), there's no point lugging a whole glob around
when you just want the filehandle.
> I also once
> accidentally caught a wild LVALUE and inspected it out of botancial
> curiosity[*] but I haven't found a use for these yet.
I feel it ought to be possible to do something interesting with a
blessed LVALUE, but I haven't worked out what yet...
Ben
------------------------------
Date: Wed, 29 Jan 2014 06:26:10 +0000 (UTC)
From: Eli the Bearded <*@eli.users.panix.com>
Subject: Re: creating a custom newsreader
Message-Id: <eli$1401290118@qz.little-neck.ny.us>
In comp.lang.perl.misc, Ben Morrow <ben@morrow.me.uk> wrote:
> (Do you realise there have been no material changes to trn in the last
> ten years? How many other ten-year-old software packages do you think
> are still in regular use?)
And it shows. Man, trn is full of bugs, and the charset support is
laughable (convert to terminal charset? nah, let's just dump the raw
stream and hope the terminal can display it). And messages with lots
of header lines can cause oddness.
Still, my fingers know it well.
Elijah
------
can't recall the last "material change" to xterm, but plenty of bug fixes
------------------------------
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 4127
***************************************