I modified Layers.pm to dump the flags.
sub _has_flags { my $check_flag = _names_to_flags(@_); return sub { my ($fh, $layer) = @_; my $iterator = natatime(3, PerlIO::get_layers($fh, details => +1)); while (my ($name, $arguments, $flags) = $iterator->()) { next if defined $layer and $name ne $layer; print('FL='.unpack('H8',pack('N',$flags)).','.unpack('B32' +,pack('N',$flags))."\n"); print('CK='.unpack('H8',pack('N',$check_flag)).','.unpack( +'B32',pack('N',$check_flag))."\n"); my $entry = $flags & $check_flag; return 1 if $entry; } return 0; } }
And the problem is, 5.10 has different flags than 5.12. I dont know yet if 5.10 has different C consts, or just different api design, and if the 16XXX/0x4000 flag is plain wrong. I havent looked if 0x4000 is hard coded in Layers the module or not.

On 5.10.
$VAR1 = { "\$mode" => "<:encoding(utf8)", "\$fh" => \*{"main::\$fh"}, "\$test_type" => "crlf", "\$result_for{\$test_type}" => 1 }; FL=00408400,00000000010000001000010000000000 CK=00004000,00000000000000000100000000000000 FL=00408400,00000000010000001000010000000000 CK=00004000,00000000000000000100000000000000 FL=00408400,00000000010000001000010000000000 CK=00004000,00000000000000000100000000000000 not ok 51 - File opened with <:encoding(utf8) should return 1 on test +crlf # Failed test 'File opened with <:encoding(utf8) should return 1 on +test crlf' # at 10-basics.t line 77. # got: '0' # expected: '1' # $VAR1 = [ # "unix", # undef, # [ # "UTF8", # "CANREAD", # "FASTGETS" # ] # ]; # $VAR2 = [ # "crlf", # undef, # [ # "UTF8", # "CANREAD", # "FASTGETS" # ] # ]; # $VAR3 = [ # "encoding", # "utf8", # [ # "UTF8", # "CANREAD", # "FASTGETS" # ] # ];
On 5.12
$VAR1 = { "\$fh" => \*{"main::\$fh"}, "\$mode" => "<:encoding(utf8)", "\$result_for{\$test_type}" => 1, "\$test_type" => "crlf" }; FL=00200400,00000000001000000000010000000000 CK=00004000,00000000000000000100000000000000 FL=00404400,00000000010000000100010000000000 CK=00004000,00000000000000000100000000000000
I will keep looking.

I made this. Dont know what to think about it. http://pastebin.com/SSDrPpDD

update, the flags come from XS in Layers.xs not hard coded consts in the PM, the flags of the layers come from http://perl5.git.perl.org/perl.git/blob/HEAD:/universal.c#l960 I dont have a C debugging enabled 5.10 so I cant give you any more advice. Search perlio.c in perl.git for changes between 5.10 and 5.12 or dont do the PIO::Layers test on 5.10. Its a design issue with 5.10, not a Layers.pm issue.

In reply to Re^3: [Win32] PerlIO-Layers fails 4 tests on perl-5.10 only by bulk88
in thread [Win32] PerlIO-Layers fails 4 tests on perl-5.10 only by syphilis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.