Larry Wall wrote:
> 
> The problem here is that I think =~ does one thing right--it brings the
> "topic" out front.  Hiding the variable to be modified clear out at the
> end of a big regex is not going to be a winner.  It's bad enough that
> the /x modifier comes at the end.
> 
> More generally, both =~ and indirect objects provide a way to put
> optional arguments out in front of mandatory arguments.  Perhaps this
> notion can be generalized somehow.  But that's a problem for -language.

Hm. That was my initial reaction to this idea, too, but I couldn't come
up with an unambiguous notation. term /pattern/ runs into lots of
conflicts, and looks too mysterious anyway. I don't want to lose
implicit matching against $_, though I wouldn't be too heartbroken if //
were discarded and m// became required.

Collected ideas (mostly not my own):

EXPR /pattern/
EXPR m/pattern/
/pattern/ EXPR
m(EXPR)/pattern/
/pattern/->(EXPR)
EXPR<-/pattern/
EXPR<=/pattern/
EXPR ~ /pattern/
match(/pattern/, EXPR)
EXPR ? /pattern/

Maybe some or all of those EXPRs should be terms. But every one has one
problem or another.

Reply via email to