in reply to Re^4: Smartmatch alternatives
in thread Smartmatch alternatives
Works fine until you want to see if an array contains any false values...
use Data::Dumper; use List::Util (); sub any (&@) { my $x = &List::Util::first; defined $x } my @x = (1..3, undef, 5..10); # undef is false print Dumper(any { !$_ } @a);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Smartmatch alternatives
by LanX (Saint) on Dec 17, 2013 at 22:08 UTC | |
|
Re^6: Smartmatch alternatives
by LanX (Saint) on Dec 17, 2013 at 22:57 UTC | |
by tobyink (Canon) on Dec 18, 2013 at 00:11 UTC | |
by LanX (Saint) on Dec 18, 2013 at 02:19 UTC | |
by tobyink (Canon) on Dec 18, 2013 at 07:34 UTC | |
by LanX (Saint) on Dec 18, 2013 at 08:15 UTC |