Juerd skribis 2005-03-28 16:44 (+0200):
>     splice @foo, $_, 1 given first { @foo[$_] ~~ 15 }, [EMAIL PROTECTED];
>     @foo [-] 15;  # whoa!

Note: unfair comparison. The equal thing would be [-]=.

In fact, this illustrates the problem even better, because to get 
@foo [-] 15 without [-], you need either a temporary array:

    do { 
        my @temp = @foo;
        splice @temp, $_, 1 given first { @temp[$_] ~~ 15 }, [EMAIL PROTECTED];
        @temp
    }

or a grep with an extra variable:

    do {
        my $seen_first;
        grep { $seen_first or $_ ~~ 15 && $seen_first++ } <== @foo
    }


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

Reply via email to