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


in reply to Regex expression is matching more than once

Here is a regex expression, it doesn't do anything

my $rex = qr/(.)/;

Operators do stuff, here is a regex inside an operator, the substitution operator, replace operator, s///

$captured_and_released =~ s/$rex/$1/;

And match operator, m//atch operator, m//

( $xerox ) = $original =~ m/$rex/;

The tr///ansliteration operator does not use regex expressions

Remember the operator name, its the function that does stuff :)