On Fri, 29 Sep 2000 01:02:40 +0100, Hugo wrote:

>It also isn't clear what parts of the expression are interpolated at
>compile time; what should the following leave in %foo?
>
>  %foo = ();
>  $bar = "one";
>  "twothree" =~ / (?$bar=two) (?$foo{$bar}=three) /x;

It's not just that. You act as if this is assignment takes place
whenever a submatch succeeds. So:

        "twofour" =~ /(?$bar=two)($foo=three)/;

Will $bar be set to "two", and $foo undef? I think not. Assignment
should be postponed to till the very end, when the match finally
succeeds, as a whole.

Therefore, I think that allowing just any l-value on the left of the "="
sign, is not practical. Or is it?

OTOH I would rather have that all submatches would be assigned to a
hash, not to global or lexical variables. I have no clue about what
syntax that would need.

-- 
        Bart.

Reply via email to