develooper Front page | perl.perl5.porters | Postings from December 2008

Re: [perl #1154] -pi doesn't sanely handle write errors

Thread Previous | Thread Next
From:
Chip Salzenberg
Date:
December 1, 2008 15:17
Subject:
Re: [perl #1154] -pi doesn't sanely handle write errors
Message ID:
20081201231656.GK31089@tytlal.topaz.cx
On Mon, Dec 01, 2008 at 11:37:49PM +0100, Johan Vromans wrote:
> Chip Salzenberg <chip@pobox.com> writes:
> > So if we had tied eof() processing and READLINE was responsive to
> > context, it could work?
> 
> Maybe a pseudo-core entry: CORE::GLOBAL::eof_argv ?

I perceive there are two basic approaches that can be taken.

One of them provides hooks in and/or out to user-level code to handle the
various events surrounding standard <> processing, but the readline and
print operations would remain unchanged (presumably for speed purposes).
This seems to be what you're talking about.

The other of them would be less hacky but perhaps not efficient enough for
some purposes.  Perl code can open ARGV and ARGVOUT and/or assign tied
filehandles to them.  Then all the <> processing, period, happens via
"normal" (ahem) tied filehandle magic.  This is something that could be done
today, modulo the '<> in list context' problem mentioned in overload.pm.

Is this a good summary?

Hard to know which of them is worth doing.
-- 
Chip Salzenberg   twitter:chipsalz
"UTOPIA PLANITIA IS IN ORBIT is the new HAN SHOT FIRST" - Crisper Than Thou

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About