my ($result)= (m[pattern(group)])[0] || "default";
The outer ()'s put the RE into a list context, then we pick off the first element, which will be the contents of the matching parens
In reply to Re: Did I match or didn't I?
by gbarr
in thread Did I match or didn't I?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |