in reply to Re: Search and Replace
in thread Search and Replace

I wouldn't use (and recommend using) $&, because of efficiency reasons. "Mastering Regular Expressions" explains why.

Replies are listed 'Best First'.
RE: RE: Re: Search and Replace
by mdillon (Priest) on Jul 19, 2000 at 20:39 UTC
    thanks. i'm aware of that, but i was only interested in shortening the s///. i've read Mastering Regular Expression cover-to-cover. i can't say that i've actually ever used $& in any Perl code i've written, since i read MRE very early in my Perl days (right after Effective Perl Programming) and took the warning you're reiterating here to heart.