The pattern in your sample code scans whatever text is in the $fileName1 variable for either of the character sequences ".met" or ".ps" and replaces them with ".ps". It does this for all occurrences within the string (the 'g' option at the end of the pattern) and regardless of upper/lower case (the 'i' option).
One of the options that is searched for is ".ps" which is the same as the replacement string. While this is not wrong (and can be a useful 'trick' if there are other things happening such as delegate functions [or whatever they are called in Perl] being called etc.) you can make the line just:
$fileName1 =~ s/\.met/\.ps/gi;
This will substitute all occurrences of ".met" with ".ps".
As for your last question, if you are only passing the filename (and nothing else) then a pattern of:
^(.*?)_PSFILE_(.*)$
and a replacement string of
$1_$2
possibly with the 'ignore case' option set, will result in the effective removal of the "_PSFILE_" text from the string. It works by capturing all of the text from the start to just before the "_PSFILE__" text in match group #1, and all of the text from after the "_PSFILE_" to the end of the string in match group #2. It then joins the two captured parts together with an underscore between them. Note that, even if the "global" option is give, this will only replace the first occurrence of "_PSFILE_" in the string.
There is an alternative which is the use the pattern:
_PSFILE_
and a replacement string of
_
This locates the "_PSFILE_" text and replaces it with an underscore. This doesn't care too much about the rest of the string, and will replace all instances of "_PSFILE_" but will do so in text such as:
This pattern will remove _PSFILE_ text character from a string
resulting in "This pattern will remove _ text character from a string".
As always there are many ways to solve the problem, and usually the "right way" depends on the broader context of your work.
Susan