12 my $file = "crlf$$.dat";
17 if (find PerlIO::Layer 'perlio') {
19 ok(open(FOO,">:crlf",$file));
20 ok(print FOO 'a'.((('a' x 14).qq{\n}) x 2000) || close(FOO));
21 ok(open(FOO,"<:crlf",$file));
24 { local $/; $text = <FOO> }
25 is(count_chars($text, "\015\012"), 0);
26 is(count_chars($text, "\n"), 2000);
30 { local $/; $text = <FOO> }
31 is(count_chars($text, "\015\012"), 2000);
35 eval 'use PerlIO::scalar';
36 skip(q/miniperl cannnot load PerlIO::scalar/)
37 if $@ =~ /dynamic loading not available/;
38 my $fcontents = join "", map {"$_\015\012"} "a".."zzz";
39 open my $fh, "<:crlf", \$fcontents;
42 my $pos = tell $fh; # pos must be behind "xxx", before "\nyyy\n"
52 skip_all("No perlio, so no :crlf");
56 my($text, $chars) = @_;
58 $seen++ while $text =~ /$chars/g;