Skip to content

Commit 4f80bc9

Browse files
avargitster
authored andcommitted
remote-mediawiki tests: replace deprecated Perl construct
The use of the encoding pragma has been a hard error since Perl 5.18 (released in 2013). What this script really wanted to do was to decode @ARGV and write out some files with the UTF-8 PerlIO layer. Let's just do that explicitly instead. This explicitly does not retain the previous UTF-8 semantics of the script. The "encoding" pragma had all sorts of global effects (program text being UTF-8, stdin/stdout etc.). But the only thing that was required was decoding @ARGV and writing out UTF-8 data, which is currently facilitated with the "open" pragma. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dde66eb commit 4f80bc9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

contrib/mw-to-git/t/test-gitmw.pl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
use MediaWiki::API;
2626
use Getopt::Long;
27-
use encoding 'utf8';
2827
use DateTime::Format::ISO8601;
2928
use open ':encoding(utf8)';
3029
use constant SLASH_REPLACEMENT => "%2F";
@@ -222,4 +221,4 @@ sub wiki_upload_file {
222221
getallpagename => \&wiki_getallpagename,
223222
);
224223
die "$0 ERROR: wrong argument" unless exists $functions_to_call{$fct_to_call};
225-
$functions_to_call{$fct_to_call}->(@ARGV);
224+
$functions_to_call{$fct_to_call}->(map { utf8::decode($_); $_ } @ARGV);

0 commit comments

Comments
 (0)