Beginning Perl free www perl.org
The /g modifier specifies global pattern matching–that is, matching as many times as possible within the string. In list context, it returns a list of the substrings matched by any capturing parentheses in the regular expression. If there are no parentheses, it returns a list of all the matched strings, as if there were parentheses …