We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 054c20f commit f51769cCopy full SHA for f51769c
lib/MetaCPAN/Server/Controller/Changes.pm
@@ -76,20 +76,15 @@ sub by_releases : Path('by_releases') : Args(0) {
76
for my $release ( @{ $ret->{releases} } ) {
77
my ( $author, $name, $path )
78
= @{$release}{qw(author name changes_file)};
79
- my $source = $c->model('Source')->path( $author, $name, $path ) // '';
+ my $source = $c->model('Source')->path( $author, $name, $path ) or next;
80
81
- my $content;
82
- try {
83
- local $/;
84
- $content = Encode::decode(
+ my $content = try {
+ Encode::decode(
85
'UTF-8',
86
- ( scalar $source->openr->getline ),
+ ( scalar $source->slurp ),
87
Encode::FB_CROAK | Encode::LEAVE_SRC
88
);
89
- }
90
- catch {
91
- $content = undef;
92
- };
+ } or next;
93
94
push @changes,
95
{
0 commit comments