http://www.perlmonks.org?node_id=98655


in reply to difference between ($scalar) and $scalar

It is a difference between the list and scalar contexts. Your pattern matching operation will return a list, but if the assignment is to a scalar (as it is in the second case) then you only get the scalar value of the list. i.e. The number of elements in the list. In this case, that's the number of matches made.

If the assignment is made to a list, which you can explicity do by putting the brackets around the variable as in your first case, then you will get the elements of the left hand side's list (in this case, the one variable $rcs) matched up with the elements of the right hand side (the matches from the regexp) on a one-for-one basis until one side reaches the end of the list.