This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
b1e754c356b3a939882cfdcdfda12ea928e50c28
[perl5.git] / t / lib / croak / pp_ctl
1 __END__
2 # NAME goto into foreach
3 no warnings 'deprecated';
4 goto f;
5 foreach(1){f:}
6 EXPECT
7 Can't "goto" into the middle of a foreach loop at - line 3.
8 ########
9 # NAME goto into given
10 no warnings 'deprecated';
11 goto f;
12 CORE::given(1){f:}
13 EXPECT
14 given is experimental at - line 3.
15 Can't "goto" into a "given" block at - line 3.
16 ########
17 # NAME goto from given topic expression
18 no warnings 'deprecated';
19 CORE::given(goto f){f:}
20 EXPECT
21 given is experimental at - line 2.
22 Can't "goto" into a "given" block at - line 2.
23 ########
24 # NAME goto into expression
25 no warnings 'deprecated';
26 eval { goto a; 1 + do { a: } }; warn $@;
27 eval { goto b; meth { b: }   }; warn $@;
28 eval { goto c; map { c: } () }; warn $@;
29 eval { goto d; f(do { d: })  }; die  $@;
30 EXPECT
31 Can't "goto" into a binary or list expression at - line 2.
32 Can't "goto" into a binary or list expression at - line 3.
33 Can't "goto" into a binary or list expression at - line 4.
34 Can't "goto" into a binary or list expression at - line 5.
35 ########
36 # NAME dump with computed label
37 no warnings 'deprecated';
38 my $label = "foo";
39 CORE::dump $label;
40 EXPECT
41 Can't find label foo at - line 3.
42 ########
43 # NAME when outside given
44 use 5.01; no warnings 'experimental::smartmatch';
45 when(undef){}
46 EXPECT
47 Can't "when" outside a topicalizer at - line 2.
48 ########
49 # NAME default outside given
50 use 5.01;
51 default{}
52 EXPECT
53 Can't "default" outside a topicalizer at - line 2.