When using 'cover -report html_basic -annotation git', the report is broken:
With a few lines of warnings like:
Use of uninitialized value $file in hash element at lib/perl5/x86_64-linux/Devel/Cover/DB.pm line 337
This is due to:
in Devel/Cover/Report/Html_basic.pm line 446:
for (@{$options->{file}}) {
$R{file} = $_;
$R{file_link} = "$R{filenames}{$_}.html";
$R{file_html} = "$options->{outputdir}/$R{file_link}";
my $show = $options->{show};
print_file;
print_branches if $show->{branch};
print_conditions if $show->{condition};
print_subroutines if $show->{subroutine} || $show->{pod};
}
Here the default variable '$_' is used for the loop, which is actually an alias for elements in '$options->{file}', and will be as input parameters for print* functions, and finally '$_' will be propagated to Devel/Cover/Annotation/Git.pm : get_annotations
my $start = 1;
while (<$c>) {
# print "[$_]\n";
if (/^\t/) {
push @$a, [@a];
$start = 1;
next;
}
if ($start == 1) {
$a[0] = substr $1, 0, 8 if /^(\w+)/;
$start = 0;
} else {
$a[1] = $1 if /^author (.*)/;
$a[2] = localtime $1 if /^author-time (.*)/;
}
}
Here, 'while (<$c>)' will also use '$_' and after the loop, $_ will be set to undef, which undef all elements in $options->{file}.
When using 'cover -report html_basic -annotation git', the report is broken:
With a few lines of warnings like: Use of uninitialized value $file in hash element at lib/perl5/x86_64-linux/Devel/Cover/DB.pm line 337
This is due to: in Devel/Cover/Report/Html_basic.pm line 446:
Here the default variable '$_' is used for the loop, which is actually an alias for elements in '$options->{file}', and will be as input parameters for print* functions, and finally '$_' will be propagated to Devel/Cover/Annotation/Git.pm : get_annotations
Here, 'while (<$c>)' will also use '$_' and after the loop, $_ will be set to undef, which undef all elements in $options->{file}.
I'll send out pull request later.