Nathan Wiger wrote:
> > If =~ allowed "indirect object" notation as -> does, then we could write
> > 
> >         s $str (pat){rep};
> > and
> >         for ( grok %db /Name/$name/g ) {
> 
> Yeah, but I'm not sure what those are supposed to do. 

Not familiar with indirect object notation?

How about 

        match $str /pat/;

        subst $str /pat/rep/;

Still too confusing?


> They look way too obscure for me.

Not a criterion for Perl, afaik.


> As written I don't see an advantage in the RFC. I think it confuses
> regexps and subs, which are two completely different things.

No, that's not what it confuses.  it confuses (intentionally, I feel
obliged to point out) match/subst *operators*, and other funcs.
Who was it that suggested changing the m// operator to the match()
function, and the s/// operator to the subst() function? 
RFC139 supports that philosophy, but implemented differently.


> I would drop
> the // overloading and just look at =~, since that's a neat operator.

I suppose I could have proposed them in separate RFC's.  But the two
are already married in the regex "binding" operations...


> What if =~ had a very similar effect to what you descibe, only it passed
> the argument as the *last* one 

I've seen your RFC on this since you wrote that email.
It's an interesting idea; but the problem with it, imo, is that, while
it seems to jive nicely with perl's (current) set of built-ins, user-
defined subs can (and typically do) have open-ended argument lists.
So, the "last" argument becomes problematic, particularly wrt prototyping.


-- 
John Porter

        We're building the house of the future together.

Reply via email to