threads / patch / 34333

patchgit-remote-mediawiki: un-brace file handles in binmode calls

Subject: [PATCH] git-remote-mediawiki: un-brace file handles in binmode calls

## tl;dr

2 messages between Jul 3, 2013 and Jul 3, 2013. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Matthieu Moy· Jul 3, 2013, 09:14 UTC · lore

Commit e83d36b66fc turned "print STDOUT" into "print {*STDOUT}", as suggested by perlcritic. Unfortunately, it also changed two "binmode STDOUT" calls the same way, which does not work and yield a "Not a GLOB reference" error.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 contrib/mw-to-git/git-remote-mediawiki.perl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to contrib/mw-to-git/git-remote-mediawiki.perl +2 −2
diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index e40c034..f8d7d2c 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -576,9 +576,9 @@ sub literal_data_raw {
 	my ($content) = @_;
 	# Avoid confusion between size in bytes and in characters
 	utf8::downgrade($content);
-	binmode {*STDOUT}, ':raw';
+	binmode STDOUT, ':raw';
 	print {*STDOUT} 'data ', bytes::length($content), "\n", $content;
-	binmode {*STDOUT}, ':encoding(UTF-8)';
+	binmode STDOUT, ':encoding(UTF-8)';
 	return;
 }
 
-- 
1.8.3.1.495.g13f33cf.dirty

← back to recent threads