2 use test::helper qw($_real $_point);
7 undef $/; # slurp it all
9 open($file, '>', 'writefile');
10 print $file "frogbing\n";
13 # fetch contents of file
14 ok(open(FILE,"writefile"),"open");
17 is(length($data),9,"right amount read");
18 is($data,"frogbing\n","right data read");
21 ok(open(FILE,'+<',"writefile"),"open");
22 ok(seek(FILE,2,0),"seek");
23 ok(print(FILE "ib"),"print");
26 # fetch contents of file
27 ok(open(FILE,"writefile"),"open");
30 is(length($data),9,"right amount read");
31 is($data,"fribbing\n","right data read");
33 # overwrite part, append some
34 ok(open(FILE,'+<',"writefile"),"open");
35 ok(seek(FILE,7,0),"seek");
36 ok(print(FILE "gle"),"print");
39 # fetch contents of file
40 ok(open(FILE,"writefile"),"open");
43 is(length($data),10,"right amount read");
44 is($data,"fribbingle","right data read");