Nathan Torkington wrote:
> 
> Nathan Wiger writes:
> >    $x =~ /a/;   # $x is roughly equivalent to a
> 
> I've been going at high speed through this thread, but has
> anyone mentioned:
> 
>   m{$foo}{^baz.*bar$}i
>   s{$foo}{(\w+) \1}{$1}g
> 
> With the first part of m{} and s{} containing an expression.

Personally, if we're going to consider this route, I say we go all the
way and just make them builtin functions:

   m($foo, '^baz.*bar$', i);
   s($foo, '(\w+) \1', '$1', g);

Yech! I take that back. But it is much more consistent.

Although I'm still missing what the big todo is about =~ and !~, why
they're so difficult compared to == and !=, and why they make so little
sense and make things so hard. I love m// and s/// as-is. I would be
very sad if they were changed without bigtime gains in functionality.
:-(

But one thing that would be cool is supporting full functions in the
left side of a pattern:

   $string =~ m/$r->getpattern/ie;

Now that would be cool.

-Nate

Reply via email to