Pattern components have an order of precedence just as operators do. If you see the following pattern:
m/a|b+/
it's hard to tell if the pattern should be
SPMquot
m/(a|b)+/" -- match either the "a" character repeated one
or more times or the "b" character repeated one
or more times.
or
SPMquot
m/a|(b+)/" -- match either the "a" character or the "b" character
repeated one or more times.
The order of precedence is designed to solve problems like this. By consulting the Perl order of precedence table, you would see that quantifiers have a higher precedence than alternation. Therefore, the second interpretation is correct.
You can use parentheses to affect the order in which components are evaluated because they have the highest precedence. However, unless you use the extended syntax, you will be affecting the pattern memory.