Perl: finding pattern and substituting

In Perl, I know pattern matching is something like, $name =~ /xxxxxx/;
If I find pattern matching using regular expression, how do I substitute it with real string?
For example, I need to find pattern, /-\d\d\d\d/, which is something like "-2000", but those 4 digits can be any numbers.
Now, I need to replace those numbers with "-<certain 4 digit number>".
Is there a way to do it in Perl?
Thank a bunch in advance!!!

Yes -- you use the substitution syntax:

s/<regex you want to find>/<string you want to substitute/

Example: s/matt/MATT/ will substitute "matt" with "MATT."

Incidentally, another way to do your regex would be /-[0-9]{4}/ and you could do your substitution like: s/-[0-9]{4}/string/