Terminal ANSI colors does not work with Inline::Perl5 (Data::Printer)

前端 未结 1 1592
鱼传尺愫
鱼传尺愫 2021-01-13 06:39

The following Perl 5 script:

use strict;
use warnings;

use Data::Printer;
my @a = (1,2,3,4);
p @a;

gives output:

(note th

相关标签:
1条回答
  • 2021-01-13 07:15

    This seems to be an issue with version 0.40 of Data::Printer which is the current version on metacpan. If I install version 0.99 from GitHub I get colors with Perl 6 also. See also this issue.

    I debugged version 0.40 a little bit, and it seems like the only difference between the call to p @a from Perl 5 version versus the same call from Perl 6, is that the Perl 6 call is called in list context, so wantarray returns true for the Perl 6 call, this apparantly makes Data::Printer turn off coloring somehow.

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