May 3, 2017, 8:34 AM
Post #2 of 2
Your statement is a conditional statement that takes the 'true' branch if the string in $a ends with the substring 'MN_C.o'. Lets take it apart. The '$' tells us that the variable $a is a scalar. The operator '=~' tells us that $a must match the following regular expression. (This tells us that $a will be interpreted as string rather than as a number.) The forward slashes mark the beginning and end of the regular expression. Most characters in a regular expression represent themselves. In your example, the '\', '.', and '$' are special. The '$' requires the match to occur at the end of the string. The '\' is called an escape character. It means that the following character (the '.' in this case) loses its special meaning and merely represents itself.
Re: [boonflies] slashes and dollar
[In reply to]