Acme-Capture

 view release on metacpan or  search on metacpan

lib/Acme/Capture.pm  view on Meta::CPAN

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
        my ($fh, $layers) = @_;
 
        my $unix_utf8_crlf = @$layers > 4
          && $layers->[0] eq 'unix'
          && $layers->[1] eq 'crlf'
          && $layers->[2] eq 'utf8'
          && $layers->[3] eq 'unix'
          && $layers->[4] eq 'encoding(utf8)' ? 1 : 0;
 
        if ($unix_utf8_crlf and $^O eq 'MSWin32') {
            binmode($fh, ':unix:encoding(utf8):crlf');
        }
        else {
            # _debug("# requested layers (@{$layers}) for @{[fileno $fh]}\n");
            my %seen = ( unix => 1, perlio => 1 ); # filter these out
            my @unique = grep { !$seen{$_}++ } @$layers;
            # _debug("# applying unique layers (@unique) to @{[fileno $fh]}\n");
            binmode($fh, join(":", ":raw", @unique));
        }
    };
 
    1;
EOT
}
 
our @ISA = qw/Exporter/;
our @EXPORT_OK = keys %api;
our %EXPORT_TAGS = ( 'all' => \@EXPORT_OK );



( run in 0.274 second using v1.01-cache-2.11-cpan-00829025b61 )