*VALID_NAME_REG_EX = \"[ a-zA-Z0-9_#.:@=-]+";
The effect is to assign $VALID_NAME_REG_EX as the Perl string literal identifier "[ a-zA-Z0-9_#.:@=-]+"
It is different from the word
$VALID_NAME_REG_EX = "[ a-zA-Z0-9_#.:@=-]+"
which copies the string to the space assigned to $VALID_NAME_REG_EX so that you can change it later
Perl literals must be read-only in order to make sense, so the result of the assignment is to make $VALID_NAME_REG_EX -only variable, otherwise known as a constant. If you try to assign it, you will receive a message similar to
Modify a read-only value
source share