12 use open qw( :utf8 :std );
14 # [perl #19566]: sv_gets writes directly to its argument via
15 # TARG. Test that we respect SvREADONLY.
16 use constant roref=>\2;
17 eval { for (roref) { $_ = <Fʜ> } };
18 like($@, 'Modification of a read-only value attempted', '[perl #19566]');
22 my $file = tempfile();
23 open Ạ,'+>',$file; $a = 3;
24 is($a .= <Ạ>, 3, '#21628 - $a .= <A> , A eof');
26 is($a .= <Ạ>, 4, '#21628 - $a .= <A> , A closed');
31 open ᕝ, '.' and sysread ᕝ, $_, 1;
36 skip "you can read directories as plain files", 2 unless( $err );
39 open ᕝ, '.' and $_=<ᕝ>;
40 ok( $!==$err && !defined($_) => 'readline( DIRECTORY )' );
45 open ᕝ, '.' and $_=<ᕝ>;
46 ok( $!==$err && !defined($_) => 'readline( DIRECTORY ) slurp mode' );
51 my $obj = bless [], "Ȼლᔆ";
53 like($obj, qr/Ȼლᔆ=ARRAY.*world/u, 'rcatline and refs');
56 my $file = tempfile();
57 open my $out_fh, ">", $file;
58 print { $out_fh } "Data\n";
62 is( scalar(<hòฟ>), "Data\n", "readline() works correctly on UTF-8 filehandles" );