in reply to Grepping from an Array using a variable as the pattern to be matched

perlre, perlretut
"." means any character.

/\.\Q$classType\E\.\Q$yearMonth\E.{4}00\.XXX_XXXXpm\z/
or
/^.{4}\.\Q$classType\E\.\Q$yearMonth\E.{4}00\.XXX_XXXXpm\z/