Skip to content

Commit

Permalink
Silence "print() on closed filehandle" warnings
Browse files Browse the repository at this point in the history
Trivial nit: If $PERLBREW_ROOT/perls/perl-*.*.*/.version is read-only (e.g.,
a root-owned, system-wide directory like "/opt/perlbrew"), don't try to write
to it.
  • Loading branch information
DabeDotCom committed Jul 15, 2014
1 parent 0165d69 commit c499ac2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/App/perlbrew.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1491,8 +1491,9 @@ sub installed_perls {
} else {
$orig_version = `$executable -e 'print \$]'`;
if ( defined $orig_version and length $orig_version ){
open my $fh, '>', $version_file;
print {$fh} $orig_version;
if (open my $fh, '>', $version_file ){
print {$fh} $orig_version;
}
}
}

Expand Down

0 comments on commit c499ac2

Please sign in to comment.