and it didn't work. $result was 1, not the contents of $1. I wrote it using ?: instead, and I can think of a few other ways to write it, so I'm not looking for immediate help on this problem.my ($result)= m[pattern(group)] || "default";
What I am wonering is exactly what the issue is, and how to get around it, for my own knowledge. I'm supposing that || forces scalar context on its arguments, and using ()'s around things doesn't help. So how would you get the RE evaluated in list context?
—John
In reply to Did I match or didn't I? by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |