On the right hand side of the = operator you have a substitution operator. Here's how the operator looks: s/PATTERN/REPLACEMENT/FLAGS. So the pattern is \*, which really means the literal * character. The replacement is the literal text "$lvl=". As often as '*' appears in the target string, it will be replaced with '$lvl='.
There is no binding operator, so this regular expression is matching and substituting against the contents of $_, the implicit "it" or "topic" variable. In other words, in the absence of an explicit target, the regexp operators bind to $_. (Or was it just a typo in your code that there is no =~ operator?)
The return value of a s///g or m//g operator in scalar context will be a true value if there was at least one match, and a false value otherwise. The true value that is returned in scalar context is defined to be the count of how many times the operator matched. The return value will be assigned to $tmp.
Dave
In reply to Re: perl statement
by davido
in thread perl statement
by Yisha sharma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |