in reply to Re (tilly) 5: Finally, a $& compromise!
in thread Finally, a $& compromise!

Ok. I think there is a bug with the current Perl right now:
#!/usr/bin/perl -l $_ = "japhy"; 1 while /(.)/g; $_ = "upset"; print $1; # does this print 'y' or 't' for you?
That code prints "t" for my bleadperl. This means that Perl is not copying the string it matches, but just using a pointer to the string. That explains why this code runs JUST AS FAST as
#!/usr/bin/perl -l $_ = "japhy"; 1 while /./g; $_ = "upset";
Now, this makes the test tilly wrote null and void.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;