in reply to Re: Smartmatch alternatives
in thread Smartmatch alternatives
And XS and it's alternative pure Perl implementation was buggy last time I looked into it.
oh did you mean first ? :)
use List::Util qw(first max maxstr min minstr reduce shuffl +e sum); first BLOCK LIST ... "first" returns the first element where the result from BLOCK is a true value.
grr @%$§ !!!...
DB<121> @a=0..10 => (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) DB<122> first { "0" eq $_ } @a => 0
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Smartmatch alternatives
by davido (Cardinal) on Dec 17, 2013 at 16:05 UTC | |
by Anonymous Monk on Dec 17, 2013 at 16:14 UTC | |
by Laurent_R (Canon) on Dec 17, 2013 at 18:52 UTC | |
by LanX (Saint) on Dec 17, 2013 at 22:37 UTC | |
by Laurent_R (Canon) on Dec 18, 2013 at 00:08 UTC | |
by Laurent_R (Canon) on Dec 18, 2013 at 15:55 UTC | |
by davido (Cardinal) on Dec 17, 2013 at 16:19 UTC | |
by tobyink (Canon) on Dec 17, 2013 at 16:29 UTC | |
by davido (Cardinal) on Dec 17, 2013 at 16:37 UTC | |
| |
by LanX (Saint) on Dec 17, 2013 at 16:13 UTC | |
by davido (Cardinal) on Dec 17, 2013 at 16:25 UTC | |
|
Re^3: Smartmatch alternatives
by Anonymous Monk on Dec 17, 2013 at 16:21 UTC | |
by LanX (Saint) on Dec 17, 2013 at 16:50 UTC | |
by tobyink (Canon) on Dec 17, 2013 at 19:01 UTC | |
by LanX (Saint) on Dec 17, 2013 at 22:08 UTC | |
by LanX (Saint) on Dec 17, 2013 at 22:57 UTC | |
by tobyink (Canon) on Dec 18, 2013 at 00:11 UTC | |
|