On Thu, 28 Sep 2000 23:54:20 +0100, Hugo wrote:

>We thought of a few other possibilities too. I think it is a shame you
>did not mention them, and explain why your proposal is better.

Let me think on it.

Is $$ the only alternative, or did I miss more? I don't think I've even
seen this $$ mentioned before?

>I still like the idea of $$, as I described it in the original thread.
>I've seen no comments for or against at this time. 

I'll try to find that "thread" back.

>>Perhaps '$$' to mean match at end of string (without /m) or at end
>>of any line (with /m)? The p52p6 translator can easily replace
>>references to $$ with ${$}.

I can't see how yet another alternative, /$$/, is any better than what
we have now: /\z/.

>:=head2 '/ms': combined '/m' and '/s'
>:
>:'/ms' still works as before. Internally, '/m' has taken over the job  of
>:matching before a newline at the end of the string, simply because /$/m
>:can match before I<every> newline.
>
>Eh? Surely /$/ms would now only match _after_ the newline, or at end of
>string, whereas before it would match before _or_ after any newline, or
>at end of string?

Oh damned, you're probably right. This makes me wonder if this is doing
the right thing...

>This seems like a read bad idea. I think you have to assume people
>are feeding you the code they want to run. At worst you should
>generate a warning, but I think it is evil not to migrate things
>properly.

Well... there's a simple solution: replace /$/ with /\Z/. That one would
remain the same. Wouldn't it? I'll surely add that.

>I don't think changing /s is the right solution. I think this will
>incline people to try and fix their problems by adding /s, without
>realising that this changes the definition of every . in their
>regexp as well.

Perhaps. I do think that, in general, textual data falls into one of
three categories:

 * text with possibly embedded newlines
 * text with no embedded newlines
 * text with an irrelevant newline at the very end.

The '/s' option is for the 1st case. No '/s' for the 3rd. As for #2: you
don't care.

-- 
        Bart.

Reply via email to