Subject: | Broken example in Cookbook.pm |
In the "Changing the order of the build process" section of
Module::Build::Cookbook.pm, the example code contains (line 227 in
Module-Build-0.2808-01):
my $i = grep {$e[$_] eq 'pod'} 0..$#e;
This grep returns a list of indices where the string 'pod' appears in
@e; $i gets set to the size of the list (always 1 assuming 'pod' only
appears once in @e). I believe a more correct version of the code to
set $i to the index of the first appearance of 'pod' in @e would be:
my ($i) = grep {$e[$_] eq 'pod'} 0..$#e;
FWIW, I'm running "perl, v5.8.8 built for i386-linux-thread-multi" under
"CentOS release 5 (Final)" (Linux kernel version "2.6.18-53.1.14.el5 #1
SMP").