Perl regex reference

Found a Perl regex reference when trying to figure out how to capitalize the first letter of every word.

The way to do the capitalization involves using the right-hand term as a perl expression:

$string =~ s/\b(\w)/uc($1)/eg

So, the Perl uc() function is invoked on the pattern match buffer from the left-hand side. Clearly, the “e” modifier is useful for many other things.

Comments are closed.