Help for this page

Select Code to Download


  1. or download this
    sub any(&@) { my $cb = shift; $cb->() && return 1 for @_; 0 }
    sub all(&@) { my $cb = shift; $cb->() || return 0 for @_; 1 }
    ...
    if (all { $_ eq 'foo' } @array) {
       ...
    }