develooper Front page | perl.perl6.language.regex | Postings from August 2000

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

From:
Nathan Torkington
Date:
August 27, 2000 19:38
Subject:
Re: RFC 164 (v1) Replace =~, !~, m//, and s/// with match() and subst()
Message ID:
14761.53423.598626.272168@prometheus.frii.com
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



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About