The easiest way to force something into list context is to use the second example that you posted. Here's an example that I used on this week's Perl Quiz of the Week, to force a globally matching regular expression to match in list context:
() = ($_[0] =~ /no spoilers :P/g);
In reply to Re: Forcing array context
by jryan
in thread Forcing array context
by jens
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |