http://www.perlmonks.org?node_id=557899


in reply to List::MoreUtils and require

The require loads the module at runtime, yet you were trying to reference one of its functions before INIT. Here is one solution:
use warnings; my @v1 = qw(4 0 0 3); my @v2 = qw(4 0 0 3); INIT { require List::MoreUtils; my $ea = List::MoreUtils::each_array(@v1, @v2); while (my ($v, $t) = $ea->()) { } }