xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/lib/strict/vars (revision 0:68f95e015346)
1*0Sstevel@tonic-gateCheck strict vars functionality
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gate__END__
4*0Sstevel@tonic-gate
5*0Sstevel@tonic-gate# no strict, should build & run ok.
6*0Sstevel@tonic-gateFred ;
7*0Sstevel@tonic-gatemy $fred ;
8*0Sstevel@tonic-gate$b = "fred" ;
9*0Sstevel@tonic-gate$a = $$b ;
10*0Sstevel@tonic-gateEXPECT
11*0Sstevel@tonic-gate
12*0Sstevel@tonic-gate########
13*0Sstevel@tonic-gate
14*0Sstevel@tonic-gateuse strict qw(subs refs) ;
15*0Sstevel@tonic-gate$fred ;
16*0Sstevel@tonic-gateEXPECT
17*0Sstevel@tonic-gate
18*0Sstevel@tonic-gate########
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gateuse strict ;
21*0Sstevel@tonic-gateno strict 'vars' ;
22*0Sstevel@tonic-gate$fred ;
23*0Sstevel@tonic-gateEXPECT
24*0Sstevel@tonic-gate
25*0Sstevel@tonic-gate########
26*0Sstevel@tonic-gate
27*0Sstevel@tonic-gate# strict vars - no error
28*0Sstevel@tonic-gateuse strict 'vars' ;
29*0Sstevel@tonic-gateuse vars qw( $freddy) ;
30*0Sstevel@tonic-gateBEGIN { *freddy = \$joe::shmoe; }
31*0Sstevel@tonic-gate$freddy = 2 ;
32*0Sstevel@tonic-gateEXPECT
33*0Sstevel@tonic-gate
34*0Sstevel@tonic-gate########
35*0Sstevel@tonic-gate
36*0Sstevel@tonic-gate# strict vars - no error
37*0Sstevel@tonic-gateuse strict 'vars' ;
38*0Sstevel@tonic-gateuse vars qw( $freddy) ;
39*0Sstevel@tonic-gatelocal $abc::joe ;
40*0Sstevel@tonic-gatemy $fred ;
41*0Sstevel@tonic-gatemy $b = \$fred ;
42*0Sstevel@tonic-gate$Fred::ABC = 1 ;
43*0Sstevel@tonic-gate$freddy = 2 ;
44*0Sstevel@tonic-gateEXPECT
45*0Sstevel@tonic-gate
46*0Sstevel@tonic-gate########
47*0Sstevel@tonic-gate
48*0Sstevel@tonic-gate# strict vars - error
49*0Sstevel@tonic-gateuse strict ;
50*0Sstevel@tonic-gate$fred ;
51*0Sstevel@tonic-gateEXPECT
52*0Sstevel@tonic-gateGlobal symbol "$fred" requires explicit package name at - line 4.
53*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
54*0Sstevel@tonic-gate########
55*0Sstevel@tonic-gate
56*0Sstevel@tonic-gate# strict vars - error
57*0Sstevel@tonic-gateuse strict 'vars' ;
58*0Sstevel@tonic-gate<$fred> ;
59*0Sstevel@tonic-gateEXPECT
60*0Sstevel@tonic-gateGlobal symbol "$fred" requires explicit package name at - line 4.
61*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
62*0Sstevel@tonic-gate########
63*0Sstevel@tonic-gate
64*0Sstevel@tonic-gate# strict vars - error
65*0Sstevel@tonic-gateuse strict 'vars' ;
66*0Sstevel@tonic-gatelocal $fred ;
67*0Sstevel@tonic-gateEXPECT
68*0Sstevel@tonic-gateGlobal symbol "$fred" requires explicit package name at - line 4.
69*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
70*0Sstevel@tonic-gate########
71*0Sstevel@tonic-gate
72*0Sstevel@tonic-gate# Check compile time scope of strict vars pragma
73*0Sstevel@tonic-gateuse strict 'vars' ;
74*0Sstevel@tonic-gate{
75*0Sstevel@tonic-gate    no strict ;
76*0Sstevel@tonic-gate    $joe = 1 ;
77*0Sstevel@tonic-gate}
78*0Sstevel@tonic-gate$joe = 1 ;
79*0Sstevel@tonic-gateEXPECT
80*0Sstevel@tonic-gateVariable "$joe" is not imported at - line 8.
81*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at - line 8.
82*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
83*0Sstevel@tonic-gate########
84*0Sstevel@tonic-gate
85*0Sstevel@tonic-gate# Check compile time scope of strict vars pragma
86*0Sstevel@tonic-gateno strict;
87*0Sstevel@tonic-gate{
88*0Sstevel@tonic-gate    use strict 'vars' ;
89*0Sstevel@tonic-gate    $joe = 1 ;
90*0Sstevel@tonic-gate}
91*0Sstevel@tonic-gate$joe = 1 ;
92*0Sstevel@tonic-gateEXPECT
93*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at - line 6.
94*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
95*0Sstevel@tonic-gate########
96*0Sstevel@tonic-gate
97*0Sstevel@tonic-gate--FILE-- abc
98*0Sstevel@tonic-gate$joe = 1 ;
99*0Sstevel@tonic-gate1;
100*0Sstevel@tonic-gate--FILE--
101*0Sstevel@tonic-gateuse strict 'vars' ;
102*0Sstevel@tonic-gaterequire "./abc";
103*0Sstevel@tonic-gateEXPECT
104*0Sstevel@tonic-gate
105*0Sstevel@tonic-gate########
106*0Sstevel@tonic-gate
107*0Sstevel@tonic-gate--FILE-- abc
108*0Sstevel@tonic-gateuse strict 'vars' ;
109*0Sstevel@tonic-gate1;
110*0Sstevel@tonic-gate--FILE--
111*0Sstevel@tonic-gaterequire "./abc";
112*0Sstevel@tonic-gate$joe = 1 ;
113*0Sstevel@tonic-gateEXPECT
114*0Sstevel@tonic-gate
115*0Sstevel@tonic-gate########
116*0Sstevel@tonic-gate
117*0Sstevel@tonic-gate--FILE-- abc
118*0Sstevel@tonic-gateuse strict 'vars' ;
119*0Sstevel@tonic-gate$joe = 1 ;
120*0Sstevel@tonic-gate1;
121*0Sstevel@tonic-gate--FILE--
122*0Sstevel@tonic-gate$joe = 1 ;
123*0Sstevel@tonic-gaterequire "./abc";
124*0Sstevel@tonic-gateEXPECT
125*0Sstevel@tonic-gateVariable "$joe" is not imported at ./abc line 2.
126*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at ./abc line 2.
127*0Sstevel@tonic-gateCompilation failed in require at - line 2.
128*0Sstevel@tonic-gate########
129*0Sstevel@tonic-gate
130*0Sstevel@tonic-gate--FILE-- abc.pm
131*0Sstevel@tonic-gateuse strict 'vars' ;
132*0Sstevel@tonic-gate$joe = 1 ;
133*0Sstevel@tonic-gate1;
134*0Sstevel@tonic-gate--FILE--
135*0Sstevel@tonic-gate$joe = 1 ;
136*0Sstevel@tonic-gateuse abc;
137*0Sstevel@tonic-gateEXPECT
138*0Sstevel@tonic-gateVariable "$joe" is not imported at abc.pm line 2.
139*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at abc.pm line 2.
140*0Sstevel@tonic-gateCompilation failed in require at - line 2.
141*0Sstevel@tonic-gateBEGIN failed--compilation aborted at - line 2.
142*0Sstevel@tonic-gate########
143*0Sstevel@tonic-gate
144*0Sstevel@tonic-gate--FILE-- abc.pm
145*0Sstevel@tonic-gatepackage Burp;
146*0Sstevel@tonic-gateuse strict;
147*0Sstevel@tonic-gate$a = 1;$f = 1;$k = 1; # just to get beyond the limit...
148*0Sstevel@tonic-gate$b = 1;$g = 1;$l = 1;
149*0Sstevel@tonic-gate$c = 1;$h = 1;$m = 1;
150*0Sstevel@tonic-gate$d = 1;$i = 1;$n = 1;
151*0Sstevel@tonic-gate$e = 1;$j = 1;$o = 1;
152*0Sstevel@tonic-gate$p = 0b12;
153*0Sstevel@tonic-gate--FILE--
154*0Sstevel@tonic-gateuse abc;
155*0Sstevel@tonic-gateEXPECT
156*0Sstevel@tonic-gateGlobal symbol "$f" requires explicit package name at abc.pm line 3.
157*0Sstevel@tonic-gateGlobal symbol "$k" requires explicit package name at abc.pm line 3.
158*0Sstevel@tonic-gateGlobal symbol "$g" requires explicit package name at abc.pm line 4.
159*0Sstevel@tonic-gateGlobal symbol "$l" requires explicit package name at abc.pm line 4.
160*0Sstevel@tonic-gateGlobal symbol "$c" requires explicit package name at abc.pm line 5.
161*0Sstevel@tonic-gateGlobal symbol "$h" requires explicit package name at abc.pm line 5.
162*0Sstevel@tonic-gateGlobal symbol "$m" requires explicit package name at abc.pm line 5.
163*0Sstevel@tonic-gateGlobal symbol "$d" requires explicit package name at abc.pm line 6.
164*0Sstevel@tonic-gateGlobal symbol "$i" requires explicit package name at abc.pm line 6.
165*0Sstevel@tonic-gateGlobal symbol "$n" requires explicit package name at abc.pm line 6.
166*0Sstevel@tonic-gateGlobal symbol "$e" requires explicit package name at abc.pm line 7.
167*0Sstevel@tonic-gateGlobal symbol "$j" requires explicit package name at abc.pm line 7.
168*0Sstevel@tonic-gateGlobal symbol "$o" requires explicit package name at abc.pm line 7.
169*0Sstevel@tonic-gateGlobal symbol "$p" requires explicit package name at abc.pm line 8.
170*0Sstevel@tonic-gateIllegal binary digit '2' at abc.pm line 8, at end of line
171*0Sstevel@tonic-gateabc.pm has too many errors.
172*0Sstevel@tonic-gateCompilation failed in require at - line 1.
173*0Sstevel@tonic-gateBEGIN failed--compilation aborted at - line 1.
174*0Sstevel@tonic-gate########
175*0Sstevel@tonic-gate
176*0Sstevel@tonic-gate# Check scope of pragma with eval
177*0Sstevel@tonic-gateno strict ;
178*0Sstevel@tonic-gateeval {
179*0Sstevel@tonic-gate    $joe = 1 ;
180*0Sstevel@tonic-gate};
181*0Sstevel@tonic-gateprint STDERR $@;
182*0Sstevel@tonic-gate$joe = 1 ;
183*0Sstevel@tonic-gateEXPECT
184*0Sstevel@tonic-gate
185*0Sstevel@tonic-gate########
186*0Sstevel@tonic-gate
187*0Sstevel@tonic-gate# Check scope of pragma with eval
188*0Sstevel@tonic-gateno strict ;
189*0Sstevel@tonic-gateeval {
190*0Sstevel@tonic-gate    use strict 'vars' ;
191*0Sstevel@tonic-gate    $joe = 1 ;
192*0Sstevel@tonic-gate};
193*0Sstevel@tonic-gateprint STDERR $@;
194*0Sstevel@tonic-gate$joe = 1 ;
195*0Sstevel@tonic-gateEXPECT
196*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at - line 6.
197*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
198*0Sstevel@tonic-gate########
199*0Sstevel@tonic-gate
200*0Sstevel@tonic-gate# Check scope of pragma with eval
201*0Sstevel@tonic-gateuse strict 'vars' ;
202*0Sstevel@tonic-gateeval {
203*0Sstevel@tonic-gate    $joe = 1 ;
204*0Sstevel@tonic-gate};
205*0Sstevel@tonic-gateprint STDERR $@;
206*0Sstevel@tonic-gate$joe = 1 ;
207*0Sstevel@tonic-gateEXPECT
208*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at - line 5.
209*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at - line 8.
210*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
211*0Sstevel@tonic-gate########
212*0Sstevel@tonic-gate
213*0Sstevel@tonic-gate# Check scope of pragma with eval
214*0Sstevel@tonic-gateuse strict 'vars' ;
215*0Sstevel@tonic-gateeval {
216*0Sstevel@tonic-gate    no strict ;
217*0Sstevel@tonic-gate    $joe = 1 ;
218*0Sstevel@tonic-gate};
219*0Sstevel@tonic-gateprint STDERR $@;
220*0Sstevel@tonic-gate$joe = 1 ;
221*0Sstevel@tonic-gateEXPECT
222*0Sstevel@tonic-gateVariable "$joe" is not imported at - line 9.
223*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at - line 9.
224*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
225*0Sstevel@tonic-gate########
226*0Sstevel@tonic-gate
227*0Sstevel@tonic-gate# Check scope of pragma with eval
228*0Sstevel@tonic-gateno strict ;
229*0Sstevel@tonic-gateeval '
230*0Sstevel@tonic-gate    $joe = 1 ;
231*0Sstevel@tonic-gate'; print STDERR $@ ;
232*0Sstevel@tonic-gate$joe = 1 ;
233*0Sstevel@tonic-gateEXPECT
234*0Sstevel@tonic-gate
235*0Sstevel@tonic-gate########
236*0Sstevel@tonic-gate
237*0Sstevel@tonic-gate# Check scope of pragma with eval
238*0Sstevel@tonic-gateno strict ;
239*0Sstevel@tonic-gateeval q[
240*0Sstevel@tonic-gate    use strict 'vars' ;
241*0Sstevel@tonic-gate    $joe = 1 ;
242*0Sstevel@tonic-gate]; print STDERR $@;
243*0Sstevel@tonic-gateEXPECT
244*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at (eval 1) line 3.
245*0Sstevel@tonic-gate########
246*0Sstevel@tonic-gate
247*0Sstevel@tonic-gate# Check scope of pragma with eval
248*0Sstevel@tonic-gateuse strict 'vars' ;
249*0Sstevel@tonic-gateeval '
250*0Sstevel@tonic-gate    $joe = 1 ;
251*0Sstevel@tonic-gate'; print STDERR $@ ;
252*0Sstevel@tonic-gateEXPECT
253*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at (eval 1) line 2.
254*0Sstevel@tonic-gate########
255*0Sstevel@tonic-gate
256*0Sstevel@tonic-gate# Check scope of pragma with eval
257*0Sstevel@tonic-gateuse strict 'vars' ;
258*0Sstevel@tonic-gateeval '
259*0Sstevel@tonic-gate    no strict ;
260*0Sstevel@tonic-gate    $joe = 1 ;
261*0Sstevel@tonic-gate'; print STDERR $@;
262*0Sstevel@tonic-gate$joe = 1 ;
263*0Sstevel@tonic-gateEXPECT
264*0Sstevel@tonic-gateGlobal symbol "$joe" requires explicit package name at - line 8.
265*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
266*0Sstevel@tonic-gate########
267*0Sstevel@tonic-gate
268*0Sstevel@tonic-gate# Check if multiple evals produce same errors
269*0Sstevel@tonic-gateuse strict 'vars';
270*0Sstevel@tonic-gatemy $ret = eval q{ print $x; };
271*0Sstevel@tonic-gateprint $@;
272*0Sstevel@tonic-gateprint "ok 1\n" unless defined $ret;
273*0Sstevel@tonic-gate$ret = eval q{ print $x; };
274*0Sstevel@tonic-gateprint $@;
275*0Sstevel@tonic-gateprint "ok 2\n" unless defined $ret;
276*0Sstevel@tonic-gateEXPECT
277*0Sstevel@tonic-gateGlobal symbol "$x" requires explicit package name at (eval 1) line 1.
278*0Sstevel@tonic-gateok 1
279*0Sstevel@tonic-gateGlobal symbol "$x" requires explicit package name at (eval 2) line 1.
280*0Sstevel@tonic-gateok 2
281*0Sstevel@tonic-gate########
282*0Sstevel@tonic-gate
283*0Sstevel@tonic-gate# strict vars with outer our - no error
284*0Sstevel@tonic-gateuse strict 'vars' ;
285*0Sstevel@tonic-gateour $freddy;
286*0Sstevel@tonic-gatelocal $abc::joe ;
287*0Sstevel@tonic-gatemy $fred ;
288*0Sstevel@tonic-gatemy $b = \$fred ;
289*0Sstevel@tonic-gate$Fred::ABC = 1 ;
290*0Sstevel@tonic-gate$freddy = 2 ;
291*0Sstevel@tonic-gateEXPECT
292*0Sstevel@tonic-gate
293*0Sstevel@tonic-gate########
294*0Sstevel@tonic-gate
295*0Sstevel@tonic-gate# strict vars with inner our - no error
296*0Sstevel@tonic-gateuse strict 'vars' ;
297*0Sstevel@tonic-gatesub foo {
298*0Sstevel@tonic-gate    our $fred;
299*0Sstevel@tonic-gate    $fred;
300*0Sstevel@tonic-gate}
301*0Sstevel@tonic-gateEXPECT
302*0Sstevel@tonic-gate
303*0Sstevel@tonic-gate########
304*0Sstevel@tonic-gate
305*0Sstevel@tonic-gate# strict vars with outer our, inner use - no error
306*0Sstevel@tonic-gateuse strict 'vars' ;
307*0Sstevel@tonic-gateour $fred;
308*0Sstevel@tonic-gatesub foo {
309*0Sstevel@tonic-gate    $fred;
310*0Sstevel@tonic-gate}
311*0Sstevel@tonic-gateEXPECT
312*0Sstevel@tonic-gate
313*0Sstevel@tonic-gate########
314*0Sstevel@tonic-gate
315*0Sstevel@tonic-gate# strict vars with nested our - no error
316*0Sstevel@tonic-gateuse strict 'vars' ;
317*0Sstevel@tonic-gateour $fred;
318*0Sstevel@tonic-gatesub foo {
319*0Sstevel@tonic-gate    our $fred;
320*0Sstevel@tonic-gate    $fred;
321*0Sstevel@tonic-gate}
322*0Sstevel@tonic-gate$fred ;
323*0Sstevel@tonic-gateEXPECT
324*0Sstevel@tonic-gate
325*0Sstevel@tonic-gate########
326*0Sstevel@tonic-gate
327*0Sstevel@tonic-gate# strict vars with elapsed our - error
328*0Sstevel@tonic-gateuse strict 'vars' ;
329*0Sstevel@tonic-gatesub foo {
330*0Sstevel@tonic-gate    our $fred;
331*0Sstevel@tonic-gate    $fred;
332*0Sstevel@tonic-gate}
333*0Sstevel@tonic-gate$fred ;
334*0Sstevel@tonic-gateEXPECT
335*0Sstevel@tonic-gateVariable "$fred" is not imported at - line 8.
336*0Sstevel@tonic-gateGlobal symbol "$fred" requires explicit package name at - line 8.
337*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
338*0Sstevel@tonic-gate########
339*0Sstevel@tonic-gate
340*0Sstevel@tonic-gate# nested our with local - no error
341*0Sstevel@tonic-gate$fred = 1;
342*0Sstevel@tonic-gateuse strict 'vars';
343*0Sstevel@tonic-gate{
344*0Sstevel@tonic-gate    local our $fred = 2;
345*0Sstevel@tonic-gate    print $fred,"\n";
346*0Sstevel@tonic-gate}
347*0Sstevel@tonic-gateprint our $fred,"\n";
348*0Sstevel@tonic-gateEXPECT
349*0Sstevel@tonic-gate2
350*0Sstevel@tonic-gate1
351*0Sstevel@tonic-gate########
352*0Sstevel@tonic-gate
353*0Sstevel@tonic-gate# "nailed" our declaration visibility across package boundaries
354*0Sstevel@tonic-gateuse strict 'vars';
355*0Sstevel@tonic-gateour $foo;
356*0Sstevel@tonic-gate$foo = 20;
357*0Sstevel@tonic-gatepackage Foo;
358*0Sstevel@tonic-gateprint $foo, "\n";
359*0Sstevel@tonic-gateEXPECT
360*0Sstevel@tonic-gate20
361*0Sstevel@tonic-gate########
362*0Sstevel@tonic-gate
363*0Sstevel@tonic-gate# multiple our declarations in same scope, different packages, no warning
364*0Sstevel@tonic-gateuse strict 'vars';
365*0Sstevel@tonic-gateuse warnings;
366*0Sstevel@tonic-gateour $foo;
367*0Sstevel@tonic-gate${foo} = 10;
368*0Sstevel@tonic-gatepackage Foo;
369*0Sstevel@tonic-gateour $foo = 20;
370*0Sstevel@tonic-gateprint $foo, "\n";
371*0Sstevel@tonic-gateEXPECT
372*0Sstevel@tonic-gate20
373*0Sstevel@tonic-gate########
374*0Sstevel@tonic-gate
375*0Sstevel@tonic-gate# multiple our declarations in same scope, same package, warning
376*0Sstevel@tonic-gateuse strict 'vars';
377*0Sstevel@tonic-gateuse warnings;
378*0Sstevel@tonic-gateour $foo;
379*0Sstevel@tonic-gate${foo} = 10;
380*0Sstevel@tonic-gateour $foo;
381*0Sstevel@tonic-gateEXPECT
382*0Sstevel@tonic-gate"our" variable $foo masks earlier declaration in same scope at - line 7.
383*0Sstevel@tonic-gate########
384*0Sstevel@tonic-gate
385*0Sstevel@tonic-gate# multiple our declarations in same scope, same package, warning
386*0Sstevel@tonic-gateuse strict 'vars';
387*0Sstevel@tonic-gateuse warnings;
388*0Sstevel@tonic-gate{ our $x = 1 }
389*0Sstevel@tonic-gate{ our $x = 0 }
390*0Sstevel@tonic-gateour $foo;
391*0Sstevel@tonic-gate{
392*0Sstevel@tonic-gate    our $foo;
393*0Sstevel@tonic-gate    package Foo;
394*0Sstevel@tonic-gate    our $foo;
395*0Sstevel@tonic-gate}
396*0Sstevel@tonic-gateEXPECT
397*0Sstevel@tonic-gate"our" variable $foo redeclared at - line 9.
398*0Sstevel@tonic-gate	(Did you mean "local" instead of "our"?)
399*0Sstevel@tonic-gate########
400*0Sstevel@tonic-gate
401*0Sstevel@tonic-gate--FILE-- abc
402*0Sstevel@tonic-gateok
403*0Sstevel@tonic-gate--FILE--
404*0Sstevel@tonic-gate# check if our variables are introduced correctly in readline()
405*0Sstevel@tonic-gatepackage Foo;
406*0Sstevel@tonic-gateuse strict 'vars';
407*0Sstevel@tonic-gateour $FH;
408*0Sstevel@tonic-gateopen $FH, "abc" or die "Can't open 'abc': $!";
409*0Sstevel@tonic-gateprint <$FH>;
410*0Sstevel@tonic-gateclose $FH;
411*0Sstevel@tonic-gateEXPECT
412*0Sstevel@tonic-gateok
413*0Sstevel@tonic-gate########
414*0Sstevel@tonic-gate
415*0Sstevel@tonic-gate# Make sure the strict vars failure still occurs
416*0Sstevel@tonic-gate# now that the `@i should be written as \@i' failure does not occur
417*0Sstevel@tonic-gate# 20000522 mjd@plover.com (MJD)
418*0Sstevel@tonic-gateuse strict 'vars';
419*0Sstevel@tonic-gateno warnings;
420*0Sstevel@tonic-gate"@i_like_crackers";
421*0Sstevel@tonic-gateEXPECT
422*0Sstevel@tonic-gateGlobal symbol "@i_like_crackers" requires explicit package name at - line 7.
423*0Sstevel@tonic-gateExecution of - aborted due to compilation errors.
424*0Sstevel@tonic-gate########
425*0Sstevel@tonic-gate# [perl #26910] hints not propagated into (?{...})
426*0Sstevel@tonic-gateuse strict 'vars';
427*0Sstevel@tonic-gateqr/(?{$foo++})/;
428*0Sstevel@tonic-gateEXPECT
429*0Sstevel@tonic-gateGlobal symbol "$foo" requires explicit package name at (re_eval 1) line 1.
430*0Sstevel@tonic-gateCompilation failed in regexp at - line 3.
431