I'm supposing that || forces scalar context on its arguments
You are supposing nearly correctly, || forces scalar context on its left argument - btw something which will be changed in Perl6 (see Exegesis 3, under the heading '... and context for all').
For solving use any of the good suggestions given elsewhere in this thread :)
-- Hofmator
In reply to Re: Did I match or didn't I?
by Hofmator
in thread Did I match or didn't I?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |