8 use Test::More tests => 19;
10 use_ok('Tie::StdHandle');
12 tie *tst,Tie::StdHandle;
16 unlink("afile.new") if -f "afile";
18 ok(open($f,"+>afile"), "open +>afile");
19 ok(open($f, "+<", "afile"), "open +<, afile");
20 ok(binmode($f), "binmode")
21 or diag("binmode: $!\n");
23 ok(-f "afile", "-f afile");
25 ok(print($f "SomeData\n"), "print");
26 is(tell($f), 9, "tell");
27 ok(printf($f "Some %d value\n",1234), "printf");
28 ok(seek($f,0,0), "seek");
31 is($b, "SomeData\n", "b eq SomeData");
34 is(read($f,($b=''),4), 4, "read(4)");
35 is($b, 'Some', "b eq Some");
36 is(getc($f), ' ', "getc");
40 ok(seek($f,0,0), "seek");
41 is(read($f,($b='scrinches'),4,4), 4, "read(4,4)"); # with offset
42 is($b, 'scriSome', "b eq scriSome");
44 ok(close($f), "close");