Ariel Scolnicov wrote in fwp:
> Ronald J Kimball <[EMAIL PROTECTED]> writes:
> 
> > > If you are prepared to change $_:
> > > 
> > > if (y/a-zA-Z//>2&&y/0-9//>1) {            # 24 chars for the test
> > >   print "not valid";
> > > }
> > 
> > That does not change $_.
> 
> But, just to keep things interesting, you can't do
>      print 'abc123' =~ y/0-9//;
> (or anything else): "Can't modify constant item in character
> translation".

Sure you can ! (with perl 5.6.1 at least ; fails for 5.005_03).
The y/xyz// case, with an empty left part, has been optimized to allow
this.

Reply via email to