This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Capitalise magic descriptions consistently
[perl5.git] / t / comp / decl.t
CommitLineData
8d063cd8
LW
1#!./perl
2
93f09d7b 3# check to see if subroutine declarations work everywhere
8d063cd8
LW
4
5sub one {
6 print "ok 1\n";
7}
8format one =
5f211341 9ok 6
8d063cd8
LW
10.
11
5f211341 12print "1..9\n";
8d063cd8 13
065f14eb
NC
14one();
15two();
8d063cd8
LW
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 }
065f14eb 29 three();
8d063cd8
LW
30}
31
065f14eb 32four();
5f211341 33five();
8d063cd8
LW
34$~ = 'one';
35write;
36$~ = 'two';
5f211341 37$foo = "ok 7";
8d063cd8
LW
38write;
39$~ = 'three';
40write;
41
42format three =
5f211341 43ok 8
8d063cd8
LW
44.
45
5f211341
Z
46if ($x eq $x) {
47 goto quux;
48}
49
50print "not ok 9\n";
51exit 1;
52
8d063cd8
LW
53sub four {
54 print "ok 4\n";
55}
5f211341
Z
56
57quux:
58sub five {
59 print "ok 5\n";
60}
61print "ok 9\n";