http://www.perlmonks.org?node_id=976821


in reply to Re: Text matching repost
in thread Text matching repost

I later realised that instead of using
if (/$start/ or /$stop/) { print; }
I could just as well use (and more efficient too):
if ($&) { print; }
The meaning of $& is explained in perlvar as
The string matched by the last successful pattern match.
You can also use $MATCH if you use English;