Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Parentheses in Perl regular expressions serve two different purposes: grouping and capture. While this is usually convenient, or at least irrelevant, it can get in the way sometimes. For instance, if you want to match the Subject: line of an e-mail, ignoring possible reply prefixes, you might use two sets of parentheses:
my ( $bs, $subject ) = /^subject:\s+(re:\s*)?(.*)/i