Perl has its own man pages, like commands do, but specifically for Perl stuff!
There's also a "perldoc" command that works a lot like man, that documents the functions and things.
For this, check out perldoc -f s (the s "function") and man perlretut (regular expressions). MagnificentSteiner here is using /e on the end of the regex to write Perl code in the replacement instead of a string (that's mentioned in the perlre man page), and then using the sprintf function to do some formatting, which, perldoc -f sprintf.
For a general intro to Perl, man perlintro!
... Oh, uh, you may need to install the perl-doc package (or equivalent) to have any of this documentation.
-- Frost