The parentheses provide list context, in which a pattern match returns the captured parts. In scalar context, the return value is just true/false depending on whether the regex matched.
See perlop.
In reply to Re^3: Substring consisting of all the characters until "character X"?
by Eliya
in thread Substring consisting of all the characters until "character X"?
by TheMartianGeek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |