This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
correct the deprecation data in Module::CoreList
[perl5.git] / t / lib / croak / toke
CommitLineData
ca8ffed2 1__END__
b255a112
FC
2# NAME foo found where operator expected
3myfunc 1,2,3
4EXPECT
5Number found where operator expected at - line 1, near "myfunc 1"
6 (Do you need to predeclare myfunc?)
7syntax error at - line 1, near "myfunc 1"
8Execution of - aborted due to compilation errors.
9########
10# NAME foo found where operator expected (after strict error, w/fatal warnings)
11use warnings FATAL => 'all';
12use strict;
13$foo;
14myfunc 1,2,3
15EXPECT
16Global symbol "$foo" requires explicit package name (did you forget to declare "my $foo"?) at - line 3.
17Number found where operator expected at - line 4, near "myfunc 1"
18 (Do you need to predeclare myfunc?)
19syntax error at - line 4, near "myfunc 1"
20Execution of - aborted due to compilation errors.
21########
488bc579
FC
22# NAME (Missing operator before ${?) [perl #123737]
230${
24EXPECT
25Scalar found where operator expected at - line 1, near "0${"
26 (Missing operator before ${?)
27syntax error at - line 1, near "0$"
28Missing right curly or square bracket at - line 1, at end of line
29Execution of - aborted due to compilation errors.
30########
5af08aed
FC
31# NAME Unterminated here-doc in string eval
32eval "<<foo"; die $@
33EXPECT
34Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1.
35########
36# NAME Unterminated here-doc in s/// string eval
37eval "s//<<foo/e"; die $@
38EXPECT
39Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1.
40########
fd2709db
FC
41# NAME Unterminated here-doc in string
42"${<<foo"; # Used to give ‘Attempt to free blah blah blah’
43EXPECT
44Can't find string terminator "foo" anywhere before EOF at - line 1.
45########
20ed5f00
FC
46# NAME Unterminated qw//
47qw/
48EXPECT
49Can't find string terminator "/" anywhere before EOF at - line 1.
50########
51# NAME Unterminated q//
52qw/
53EXPECT
54Can't find string terminator "/" anywhere before EOF at - line 1.
55########
56# NAME Unterminated ''
57'
58EXPECT
59Can't find string terminator "'" anywhere before EOF at - line 1.
60########
4407f1b8
FC
61# NAME /\N{/
62/\N{/
63EXPECT
64Missing right brace on \N{} or unescaped left brace after \N at - line 1, within pattern
ca53e5d5 65Execution of - aborted due to compilation errors.
4407f1b8 66########
e660c409
FC
67# NAME map{for our *a...
68map{for our *a (1..10) {$_.=$x}}
69EXPECT
70Missing $ on loop variable at - line 1.
71########
ca8ffed2 72# NAME Missing name in "my sub"
e7d0b801 73use feature 'lexical_subs'; my sub;
ca8ffed2 74EXPECT
e7d0b801 75The lexical_subs feature is experimental at - line 1.
ca8ffed2 76Missing name in "my sub" at - line 1.
6f2d7fc9 77########
8767b1ab 78# NAME Missing name in "our sub"
e7d0b801 79use feature 'lexical_subs'; our sub;
8767b1ab 80EXPECT
e7d0b801 81The lexical_subs feature is experimental at - line 1.
8767b1ab
FC
82Missing name in "our sub" at - line 1.
83########
84# NAME Missing name in "state sub"
e7d0b801 85use 5.01; use feature 'lexical_subs';
8767b1ab
FC
86state sub;
87EXPECT
64fbf0dd 88The lexical_subs feature is experimental at - line 2.
8767b1ab
FC
89Missing name in "state sub" at - line 2.
90########
a21eb52b
FC
91# NAME my sub pack::foo
92use feature 'lexical_subs', 'state';
93my sub foo::bar;
94state sub foo::bear;
95EXPECT
96The lexical_subs feature is experimental at - line 2.
97The lexical_subs feature is experimental at - line 3.
98"my" subroutine &foo::bar can't be in a package at - line 2, near "my sub foo::bar"
99"state" subroutine &foo::bear can't be in a package at - line 3, near "state sub foo::bear"
100Execution of - aborted due to compilation errors.
101########
b2e3d01a
FC
102# NAME Integer constant overloading returning undef
103use overload;
247a7f40
FC
104BEGIN { overload::constant integer => sub {}; undef *^H }
1051
106EXPECT
bb4784f0 107Constant(1) unknown at - line 3, at end of line
247a7f40
FC
108Execution of - aborted due to compilation errors.
109########
110# NAME Float constant overloading returning undef
111use overload;
112BEGIN { overload::constant float => sub {}; undef *^H }
1131.1
114EXPECT
bb4784f0 115Constant(1.1) unknown at - line 3, at end of line
247a7f40
FC
116Execution of - aborted due to compilation errors.
117########
118# NAME Binary constant overloading returning undef
119use overload;
120BEGIN { overload::constant binary => sub {}; undef *^H }
1210x1
122EXPECT
bb4784f0 123Constant(0x1) unknown at - line 3, at end of line
247a7f40
FC
124Execution of - aborted due to compilation errors.
125########
126# NAME String constant overloading returning undef
127use overload;
128BEGIN { overload::constant q => sub {}; undef *^H }
129'1', "1$_", tr"a"", s""a"
130EXPECT
131Constant(q) unknown at - line 3, near "'1'"
132Constant(qq) unknown at - line 3, within string
133Constant(tr) unknown at - line 3, within string
134Constant(s) unknown at - line 3, within string
135Execution of - aborted due to compilation errors.
136########
137# NAME Regexp constant overloading when *^H is undefined
138use overload;
139BEGIN { overload::constant qr => sub {}; undef *^H }
140/a/, m'a'
141EXPECT
142Constant(qq) unknown at - line 3, within pattern
143Constant(q) unknown at - line 3, within pattern
144Execution of - aborted due to compilation errors.
145########
146# NAME \N{...} when charnames fails to load but without an error
d4ead2eb 147# SKIP ? exists $ENV{PERL_UNICODE} ? "Unreliable under some PERL_UNICODE settings" : 0
247a7f40
FC
148BEGIN { ++$_ for @INC{"charnames.pm","_charnames.pm"} }
149"\N{a}"
150EXPECT
151Constant(\N{a}) unknown at - line 2, within string
152Execution of - aborted due to compilation errors.
153########
154# NAME Integer constant overloading returning undef
155use overload;
b2e3d01a
FC
156BEGIN { overload::constant integer => sub {} }
1571
158EXPECT
bb4784f0 159Constant(1): Call to &{$^H{integer}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
160Execution of - aborted due to compilation errors.
161########
162# NAME Float constant overloading returning undef
163use overload;
164BEGIN { overload::constant float => sub {} }
1651.1
166EXPECT
bb4784f0 167Constant(1.1): Call to &{$^H{float}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
168Execution of - aborted due to compilation errors.
169########
170# NAME Binary constant overloading returning undef
171use overload;
172BEGIN { overload::constant binary => sub {} }
1730x1
174EXPECT
bb4784f0 175Constant(0x1): Call to &{$^H{binary}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
176Execution of - aborted due to compilation errors.
177########
178# NAME String constant overloading returning undef
179use overload;
180BEGIN { overload::constant q => sub {} }
181'1', "1$_", tr"a"", s""a"
182EXPECT
183Constant(q): Call to &{$^H{q}} did not return a defined value at - line 3, near "'1'"
184Constant(qq): Call to &{$^H{q}} did not return a defined value at - line 3, within string
185Constant(tr): Call to &{$^H{q}} did not return a defined value at - line 3, within string
186Constant(s): Call to &{$^H{q}} did not return a defined value at - line 3, within string
187Execution of - aborted due to compilation errors.
188########
189# NAME Regexp constant overloading returning undef
190use overload;
191BEGIN { overload::constant qr => sub {} }
192/a/, m'a'
193EXPECT
194Constant(qq): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
195Constant(q): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
196Execution of - aborted due to compilation errors.
197########
67c71cbb
FC
198# NAME Failed constant overloading should not cause a double free
199use overload;
200BEGIN { overload::constant q => sub {}; undef *^H }
201undef(1,2);
202undef(1,2);
203undef(1,2);
204undef(1,2);
205undef(1,2);
206undef(1,2);
207undef(1,2);
208undef(1,2);
209undef(1,2);
210"a"
211EXPECT
212Too many arguments for undef operator at - line 3, near "2)"
213Too many arguments for undef operator at - line 4, near "2)"
214Too many arguments for undef operator at - line 5, near "2)"
215Too many arguments for undef operator at - line 6, near "2)"
216Too many arguments for undef operator at - line 7, near "2)"
217Too many arguments for undef operator at - line 8, near "2)"
218Too many arguments for undef operator at - line 9, near "2)"
219Too many arguments for undef operator at - line 10, near "2)"
220Too many arguments for undef operator at - line 11, near "2)"
221Constant(q) unknown at - line 12, near ""a""
222- has too many errors.
223########
6f2d7fc9
FC
224# NAME Unterminated delimiter for here document
225<<"foo
226EXPECT
227Unterminated delimiter for here document at - line 1.