use strict; use warnings; use Test::More tests => 1; use Test::NoWarnings; 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', }, }; my @book_list; 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 }