Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix unintentionally short local scoping
  • Loading branch information
David Christensen committed Nov 13, 2017
1 parent 3f2fae4 commit b6ebec3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Vend/File.pm
Expand Up @@ -96,10 +96,8 @@ sub writefile {
}
# We have checked for beginning > or | previously
open(MVLOGDATA, $file) or die "open\n";
if ($encoding) {
local $PerlIO::encoding::fallback = $fallback;
binmode(MVLOGDATA, ":encoding($encoding)");
}
local $PerlIO::encoding::fallback = $fallback if $encoding;
binmode(MVLOGDATA, ":encoding($encoding)") if $encoding;

lockfile(\*MVLOGDATA, 1, 1) or die "lock\n";
seek(MVLOGDATA, 0, 2) or die "seek\n";
Expand Down

0 comments on commit b6ebec3

Please sign in to comment.