in reply to Re: assigning regex matches to variables
in thread assigning regex matches to variables

context plays such a central role in perl that it isn't repeated at every opportunity how you can get it. Usually every tutorial or reference text on perl will tell you about context in one of the first chapters. Note that CountZero's exerpt of the regex documentation specifically mentions context

Changing the value of a variable with a regex is done with the s/// operator, i.e. for example

$f=~ s/must/can/g;

would subsitute every occurance of "must" in the variable $f to "can"