D
dennishancy
Trying to figure out the substitution operator in Perl.
The documentation shows the syntax as
s/PATTERN/REPLALCEMENT/
and explains that the operator searches a string for PATTERN and
replaces that match with the REPLACEMENT text.
My question then is this. What string is being searched? The
documention goes on to say that if no string is specified, the $_
variable is search.
What is the $_ variable?
Dennis Hancy
Eaton Corporation
Cleveland, OH
The documentation shows the syntax as
s/PATTERN/REPLALCEMENT/
and explains that the operator searches a string for PATTERN and
replaces that match with the REPLACEMENT text.
My question then is this. What string is being searched? The
documention goes on to say that if no string is specified, the $_
variable is search.
What is the $_ variable?
Dennis Hancy
Eaton Corporation
Cleveland, OH