Mega Code Archive

 
Categories / Perl / Language Basics
 

The Substitution Operator and $_

The substitution operator uses the $_ variable if you do not specify a variable using =~.  For example, the following statement replaces the first occurrence of abc in $_ with def:  s/abc/def/;