On Mon, Jan 29, 2007 at 10:39:27AM -0800, [EMAIL PROTECTED] wrote:
> +Because C<gather> evaluates its block or statement in void context,
> +this typically causes the C<take> statement to be evaluated in void
> +context. However, a C<take> statement that is not in void context
> +gathers its arguments I<en passant> and also returns them unchanged.
> +This makes it easy to keep track of what you last "took":
> +
> + my @uniq = gather for @list {
> + state $previous = take $_;
> + next if $_ === $previous;
> + $previous = take $_;
> + }
What does it mean for take to be evaluated in void context?
What are the gathered values here?
take 1, 2; # easy. flattened 1 and then 2, right?
@x = take 1, 2; # same thing?
$x = take 1, 2; # same thing? [1, 2]?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/