in reply to Re: Re: (3): Perl 6 will make amends (was:Perl's Bad Ideas)
in thread Perl's Bad Ideas
# Example: findone { coderef } @array # Example 1. WORKS while (my ($el,$index) = findone { m/good/ } @potentially_huge_array) +{ # Found match in $el do something. } # Example 2. DOESN"T WORK my @tokens = (tokens here); while ($line =<>){ chomp($line); die "$line is not a valid token" unless findone { m/^$line/ } @tok +ens; # Fails after all elements have been processed and will always fai +l from now on. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: (3): Perl 6 will make amends (was:Perl's Bad Ideas)
by TheDamian (Vicar) on Apr 10, 2002 at 00:20 UTC | |
by shotgunefx (Parson) on Apr 10, 2002 at 00:59 UTC |