in reply to Forcing array context
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);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Forcing array context
by submersible_toaster (Chaplain) on Nov 22, 2002 at 10:01 UTC | |
by broquaint (Abbot) on Nov 22, 2002 at 11:14 UTC | |
by jryan (Vicar) on Nov 22, 2002 at 19:38 UTC | |
by submersible_toaster (Chaplain) on Nov 22, 2002 at 22:35 UTC |