in reply to Re (tilly) 5: Finally, a $& compromise!
in thread Finally, a $& compromise!
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"; print $1; # does this print 'y' or 't' for you?
Now, this makes the test tilly wrote null and void.#!/usr/bin/perl -l $_ = "japhy"; 1 while /./g; $_ = "upset";
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
|---|