xref: /openbsd/gnu/usr.bin/perl/t/comp/decl.t (revision 3d8817e4)
1#!./perl
2
3# check to see if subroutine declarations work everwhere
4
5sub one {
6    print "ok 1\n";
7}
8format one =
9ok 5
10.
11
12print "1..7\n";
13
14one();
15two();
16
17sub two {
18    print "ok 2\n";
19}
20format two =
21@<<<
22$foo
23.
24
25if ($x eq $x) {
26    sub three {
27	print "ok 3\n";
28    }
29    three();
30}
31
32four();
33$~ = 'one';
34write;
35$~ = 'two';
36$foo = "ok 6";
37write;
38$~ = 'three';
39write;
40
41format three =
42ok 7
43.
44
45sub four {
46    print "ok 4\n";
47}
48