Skip to content

Commit

Permalink
Use lowercase for lexical variables -- even filehandles
Browse files Browse the repository at this point in the history
Per rjbs code review in #18950
  • Loading branch information
jkeenan committed Jul 6, 2021
1 parent b7797b7 commit ca8c8b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions ext/Pod-Html/lib/Pod/Html.pm
Expand Up @@ -574,16 +574,16 @@ sub _save_page {
sub write_file {
my ($globals, $output) = @_;
$globals->{Htmlfile} = "-" unless $globals->{Htmlfile}; # stdout
my $FHOUT;
my $fhout;
if($globals->{Htmlfile} and $globals->{Htmlfile} ne '-') {
open $FHOUT, ">", $globals->{Htmlfile}
open $fhout, ">", $globals->{Htmlfile}
or die "$0: cannot open $globals->{Htmlfile} file for output: $!\n";
} else {
open $FHOUT, ">-";
open $fhout, ">-";
}
binmode $FHOUT, ":utf8";
print $FHOUT $output;
close $FHOUT or die "Failed to close $globals->{Htmlfile}: $!";
binmode $fhout, ":utf8";
print $fhout $output;
close $fhout or die "Failed to close $globals->{Htmlfile}: $!";
chmod 0644, $globals->{Htmlfile} unless $globals->{Htmlfile} eq '-';
}

Expand Down
12 changes: 6 additions & 6 deletions ext/Pod-Html/t/lib/Testing.pm
Expand Up @@ -672,19 +672,19 @@ sub record_state_of_cache {
die("'run' element takes integer") unless $args->{run} =~ m/^\d+$/;

my @cachelines = ();
open my $IN, '<', $cache or die "Unable to open $cache for reading";
while (my $l = <$IN>) {
open my $in, '<', $cache or die "Unable to open $cache for reading";
while (my $l = <$in>) {
chomp $l;
push @cachelines, $l;
}
close $IN or die "Unable to close $cache after reading";
close $in or die "Unable to close $cache after reading";

my $outfile = catfile($args->{outdir}, "$args->{run}.cache.$args->{stub}.$$.txt");
die("$outfile already exists; did you remember to increment the 'run' argument?")
if -f $outfile;
open my $OUT, '>', $outfile or die "Unable to open $outfile for writing";
print $OUT "$_\n" for (sort @cachelines);
close $OUT or die "Unable to close after writing";
open my $out, '>', $outfile or die "Unable to open $outfile for writing";
print $out "$_\n" for (sort @cachelines);
close $out or die "Unable to close after writing";
print STDERR "XXX: cache (sorted): $outfile\n";
}

Expand Down

0 comments on commit ca8c8b6

Please sign in to comment.