#!./perl
# check to see if subroutine declarations work everywhere
sub
one {
"ok 1\n"
;
}
format
one =
ok 6
.
"1..9\n"
;
one();
two();
sub
two {
"ok 2\n"
;
}
format
two =
@<<<
$foo
.
if
(
$x
eq
$x
) {
sub
three {
"ok 3\n"
;
}
three();
}
four();
five();
$~ =
'one'
;
write
;
$~ =
'two'
;
$foo
=
"ok 7"
;
write
;
$~ =
'three'
;
write
;
format
three =
ok 8
.
if
(
$x
eq
$x
) {
goto
quux;
}
"not ok 9\n"
;
exit
1;
sub
four {
"ok 4\n"
;
}
quux:
sub
five {
"ok 5\n"
;
}
"ok 9\n"
;