1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
__END__
# NAME goto into foreach
no warnings 'deprecated';
goto f;
foreach(1){f:}
EXPECT
Can't "goto" into the middle of a foreach loop at - line 3.
########
# NAME goto into given
no warnings 'deprecated';
goto f;
CORE::given(1){f:}
EXPECT
Can't "goto" into a "given" block at - line 3.
########
# NAME goto from given topic expression
no warnings 'deprecated';
CORE::given(goto f){f:}
EXPECT
Can't "goto" into a "given" block at - line 2.
########
# NAME goto into expression
no warnings 'deprecated';
eval { goto a; 1 + do { a: } }; warn $@;
eval { goto b; meth { b: } }; warn $@;
eval { goto c; map { c: } () }; warn $@;
eval { goto d; f(do { d: }) }; die $@;
EXPECT
Can't "goto" into a binary or list expression at - line 2.
Can't "goto" into a binary or list expression at - line 3.
Can't "goto" into a binary or list expression at - line 4.
Can't "goto" into a binary or list expression at - line 5.
########
# NAME dump with computed label
no warnings 'deprecated';
my $label = "foo";
CORE::dump $label;
EXPECT
Can't find label foo at - line 3.
########
# NAME when outside given
use 5.01; no warnings 'deprecated';
when(undef){}
EXPECT
Can't "when" outside a topicalizer at - line 2.
########
# NAME default outside given
use 5.01;
default{}
EXPECT
Can't "default" outside a topicalizer at - line 2.
########
# NAME croak with read only $@
eval '"a" =~ /${*@=\_})/';
die;
# this would previously recurse infinitely in the eval
EXPECT
Unmatched ) in regex; marked by <-- HERE in m/_) <-- HERE / at (eval 1) line 1.
...propagated at - line 2.
########
# NAME last from smartmatch CV
0 ~~ sub {last} for 0
EXPECT
Can't "last" outside a loop block at - line 1.
########
# NAME redo from smartmatch CV
0 ~~ sub {redo} for 0
EXPECT
Can't "redo" outside a loop block at - line 1.
########
# NAME next from smartmatch CV
0 ~~ sub {next} for 0
EXPECT
Can't "next" outside a loop block at - line 1.
########
# NAME goto loop label from smartmatch CV
FOO: 0~~sub{goto FOO} for 0
EXPECT
Can't find label FOO at - line 1.
########
# NAME last from smartmatch CV against array
my @x = (0);
@x ~~ sub {last} for 0
EXPECT
Can't "last" outside a loop block at - line 2.
########
# NAME redo from smartmatch CV against array
my @x = (0);
@x ~~ sub {redo} for 0
EXPECT
Can't "redo" outside a loop block at - line 2.
########
# NAME next from smartmatch CV against array
my @x = (0);
@x ~~ sub {next} for 0
EXPECT
Can't "next" outside a loop block at - line 2.
########
# NAME goto loop label from smartmatch CV against array
my @x = (0);
FOO:@x ~~sub{goto FOO} for 0
EXPECT
Can't find label FOO at - line 2.
########
# NAME last from smartmatch CV against hash
my %x = qw(a b);
%x ~~ sub {last} for 0
EXPECT
Can't "last" outside a loop block at - line 2.
########
# NAME redo from smartmatch CV against hash
my %x = qw(a b);
%x ~~ sub {redo} for 0
EXPECT
Can't "redo" outside a loop block at - line 2.
########
# NAME next from smartmatch CV against hash
my %x = qw(a b);
%x ~~ sub {next} for 0
EXPECT
Can't "next" outside a loop block at - line 2.
########
# NAME goto loop label from smartmatch CV against hash
my %x = qw(a b);
FOO:%x ~~sub{goto FOO} for 0
EXPECT
Can't find label FOO at - line 2.
|