in reply to Pattern Matching and replacement
substr(). One of the nifty aspects of Perl is that substr() can act as an LVALUE. That is, you can assign into it.
perldoc -f substr for details.