for my $key (keys %$characters) {
my $character = $characters->{$key};
my $name = $character->{Name};
# about 30 more lines of code to munge the data
my @novels = split(/, /, $character->{book}); # line 132 in code
my $first_book = $novels[0];
my $first_type = $first_book =~ /^M/ ? 'major' : $first_book =~ /^m/ ? 'mentioned' : undef; # line 134 in code
$first_book =~ s/\D//g; # line 135 in code
$character->{intro}->{book} = $book_list[$first_book]; # line 136 in code
$character->{intro}->{type} = $first_type;
$character->{book} = \@novels;
# about 30 more lines of code to munge the data
}
####
my $characters = {
Bink => {
Name => 'Bink',
book => 'M1, M2, m3, m4, 6, m7, M9, m11, m13, 14, 17, m19, m21, M22, m23, m31, 35, 36, m37, m40, m41',
},
Quan => {
Name => 'Quan',
book => '0',
},
};
##
##
character_tests.pl: Use of uninitialized value in split at character_tests.pl line 132
character_tests.pl: Use of uninitialized value $first_book in pattern match (m//) at character_tests.pl line 134
character_tests.pl: Use of uninitialized value $first_book in pattern match (m//) at character_tests.pl line 134
character_tests.pl: Use of uninitialized value $first_book in substitution (s///) at character_tests.pl line 135
character_tests.pl: Use of uninitialized value $first_book in array element at character_tests.pl line 136