This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Implement:
[perl5.git] / t / lib / io_scalar.t
CommitLineData
f6c77cf1
NIS
1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 unless (defined &perlio::import) {
7 print "1..0 # Skip: not perlio\n";
8 exit 0;
9 }
10}
11
12$| = 1;
13print "1..9\n";
14
15my $fh;
16my $var = "ok 2\n";
17open($fh,"+<",\$var) or print "not ";
18print "ok 1\n";
19print <$fh>;
20print "not " unless eof($fh);
21print "ok 3\n";
22seek($fh,0,0) or print "not ";
23print "not " if eof($fh);
24print "ok 4\n";
25print "ok 5\n";
26print $fh "ok 7\n" or print "not ";
27print "ok 6\n";
28print $var;
29$var = "foo\nbar\n";
30seek($fh,0,0) or print "not ";
31print "not " if eof($fh);
32print "ok 8\n";
33print "not " unless <$fh> eq "foo\n";
34print "ok 9\n";
35