regex - What do Perl identifiers starting with an asterisk * represent? -


i have sub-routine has identifiers defined like

*valid_name_reg_ex = \"[ a-za-z0-9_#.:@=-]+"; *macro_valid_name  = \"macro_valid_name"; 

i looked file further. referenced $macro_valid_name.

i guess it's substituting value right side of string, not sure of , want confirmation.

*valid_name_reg_ex = \"[ a-za-z0-9_#.:@=-]+"; 

the effect has assign $valid_name_reg_ex identifier perl string literal "[ a-za-z0-9_#.:@=-]+"

this different saying

$valid_name_reg_ex = "[ a-za-z0-9_#.:@=-]+" 

which copies string space assigned $valid_name_reg_ex may later altered

perl literals have read-only make sense, result of assignment make $valid_name_reg_ex read-only variable, otherwise known constant. if try assigning message like

modification of read-only value attempted


Comments