>On Thu, Nov 27, 2008 at 12:52:08PM +0100, H.Merijn Brand wrote:
>> On Thu, 27 Nov 2008 03:28:50 -0800, Chip Salzenberg <chip@pobox.com> wrote:
>> > -i.bak - unsafe .bak
>> > -i'*.bak' - unsafe .bak
>> > -i'**.bak' - safe .bak
>> -i'**' - safe (using tmpfile), remove tmp on success
>Yup, it all fits.
>Code that wants to use safe renaming when possible and work elsewhere will
>have to check $], e.g.:
> BEGIN { $^I = $] >= 5.11 ? '**.bak' : '*.bak' }
>or
> #!/usr/bin/perl -pi~
> BEGIN { $^I = '**~' if $] >= 5.11 }
>which doesn't quite match the simplicity of the alternatively proposed
> ${^INPLACE_SAFE}++
>but I can certainly live with it.
>Objections?
Um, Chip, are people *really* claiming that fixing the -i output
flush bug is something that would be "backwards incompatible",
and thus prequire some notice that such a thing is desired?!?
If so, I'm boggling. If not, I need to read more.
--tom
Thread Previous
|
Thread Next