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 14:04
Subject:
Re: [perl #1154] -pi doesn't sanely handle write errors
Message ID:
20081201220401.GF31089@tytlal.topaz.cx
On Sat, Nov 29, 2008 at 11:14:26PM +0100, Johan Vromans wrote:
> Chip Salzenberg <chip@pobox.com> writes:
> > Objections?
> [...]
> So my alternative approach would be to first sort this out, making it
> possible for a user module to completely take over <> functionality.
> Issues like error handling and safe inplace editing can then easily be
> handled with appropriate modules.

That's a clever thought.  Adding -Meditsafe (just to pick a nice pragma) to
a command line isn't as catchy as -j~ or -i'**~' but it does offer an easy
upgrade path for backward compatibility:

  eval "use editsafe"; # error OK

And you just know that Ingy will find a clever use for overloaded <>.

> = What didn't work? IIRC there were issues with not being able to
>   override eof (eof, eof() and eof(FILE)). Also, overloading <> 
>   only does scalar IO, since it ignores context.

So if we had tied eof() processing and READLINE was responsive to context,
it could work?
-- 
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