Re: RFC 164 (v1) Replace =~, !~, m//, and s/// with match() and subst()

[email protected] (Nathan Torkington)
Newsgroups perl.perl6.language.regex
Message-ID <[email protected]>
Nathan Wiger writes:
> Honestly, not sure. Although, there are two things I'd say about it:
> 
>    1. I don't think it's a showstopper for this RFC, since the
>       feature you are addressing is actually a new piece of
>       functionality.

Hmm.  This is exactly the same situation as with chomp() and somehow
chomp() can tell the difference between:

  $_ = "hi\n";
  chomp;

and

  @strings = ();
  chomp @strings;

But chomp seems to use @ as its indicator.  You can't say:

  $_ = $a = "hi\n";
  chomp $_, $a;

If it sees that $, it figures its chomp SCALAR.

I'm unsure if this is adequate for match, but it might be.

>    2. I don't think it's even closely tied to this RFC itself.

This is the mindset that worries me: every edge case needs another
RFC.  Look to what's already in Perl: does anything else behave like
this?  How does it get around it?  Can we co-opt the way it works?

Nat
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.