3 # "This IS structured code. It's just randomly structured."
24 print "#1\t:$foo: == 2\n";
25 if ($foo == 2) {print "ok 1\n";} else {print "not ok 1\n";}
29 print "#2\t:$foo: == 4\n";
30 if ($foo == 4) {print "ok 2\n";} else {print "not ok 2\n";}
32 $PERL = ($^O eq 'MSWin32') ? '.\perl' : './perl';
33 $x = `$PERL -e "goto foo;" 2>&1`;
34 if ($x =~ /DCL-W-NOCOMD/) { $x = `\$ mcr sys\$disk:[]perl. -e "goto foo;"`; }
36 if ($x =~ /label/) {print "ok 3\n";} else {print "not ok 3\n";}
59 # does goto LABEL handle block contexts correctly?
84 # Test autoloading mechanism.
87 ($pack, $file, $line) = caller; # Should indicate original call stats.
88 print "@_ $pack $file $line" eq "1 2 3 main $FILE $LINE"
95 sub one { print "ok 6\n"; goto &two; print "not ok 6\n"; }
101 $LINE = __LINE__ + 1;
105 eval { goto $wherever };
106 print $@ =~ /Can't find label NOWHERE/ ? "ok 8\n" : "not ok 8\n";
108 # see if a modified @_ propagates
111 sub DESTROY { my $s = shift; print "ok $s->[0]\n"; }
112 sub show { print "# @_\nnot ok $_[0][0]\n" if @_ != 5; }
113 sub start { push @_, 1, "foo", {}; goto &show; }
114 for (9..11) { start(bless([$_]), 'bar'); }
121 sub AUTOLOAD { print @_ }