Does the autodie-pragma have influence on the encoding?

后端 未结 1 1520
甜味超标
甜味超标 2020-12-09 17:40

Why do I get after the \"autodie\" a different output?

#!/usr/bin/env perl
use warnings;
use 5.012;
use utf8;
use open \':encoding(utf-8)\';
use open \':std         


        
1条回答
  •  北海茫月
    2020-12-09 18:16

    Unless someone comes in with a better reason, this looks like a bug with autodie in relation to the open pragma.

    Changing the last open to open my $fh2, '<:utf8', 'test.txt'; fixes the problem on my system. So that could be a temporary work around.

    I just checked RT, and this is a registered bug:

    https://rt.cpan.org/Public/Bug/Display.html?id=54777

    Looks like it has to do with each pragma using different ways of overloading the open function.

    0 讨论(0)
提交回复
热议问题