This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
stop "const in void context" warning for a const in an
[perl5.git] / t / io / print.t
1 #!./perl
2
3 BEGIN {
4     chdir 't' if -d 't';
5     @INC = '../lib';
6 }
7
8 use strict 'vars';
9 use Errno;
10
11 print "1..19\n";
12
13 my $foo = 'STDOUT';
14 print $foo "ok 1\n";
15
16 print "ok 2\n","ok 3\n","ok 4\n";
17 print STDOUT "ok 5\n";
18
19 open(foo,">-");
20 print foo "ok 6\n";
21
22 printf "ok %d\n",7;
23 printf("ok %d\n",8);
24
25 my @a = ("ok %d%c",9,ord("\n"));
26 printf @a;
27
28 $a[1] = 10;
29 printf STDOUT @a;
30
31 $, = ' ';
32 $\ = "\n";
33
34 print "ok","11";
35
36 my @x = ("ok","12\nok","13\nok");
37 my @y = ("15\nok","16");
38 print @x,"14\nok",@y;
39 {
40     local $\ = "ok 17\n# null =>[\000]\nok 18\n";
41     print "";
42 }
43
44 if (!exists &Errno::EBADF) {
45     print "ok 19 # skipped: no EBADF\n";
46 } else {
47     $! = 0;
48     print NONEXISTENT "foo";
49     print "not " if ($! != &Errno::EBADF);
50     print "ok 19\n";
51 }