This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 9
[perl5.git] / t / comp / package.t
CommitLineData
a687059c
LW
1#!./perl
2
3print "1..7\n";
4
5$blurfl = 123;
6$foo = 3;
7
8package XYZ;
9
10$bar = 4;
11
12{
13 package ABC;
14 $blurfl = 5;
15 $main'a = $'b;
16}
17
18$ABC'dyick = 6;
19
20$xyz = 2;
21
463ee0b2
LW
22$main = join(':', sort(keys %::_main));
23$XYZ = join(':', sort(keys %::_XYZ));
24$ABC = join(':', sort(keys %::_ABC));
a687059c
LW
25
26print $XYZ eq 'ABC:XYZ:bar:main:xyz' ? "ok 1\n" : "not ok 1 '$XYZ'\n";
463ee0b2 27print $ABC eq 'blurfl:dyick' ? "ok 2\n" : "not ok 2 '$ABC'\n";
a687059c 28print $main'blurfl == 123 ? "ok 3\n" : "not ok 3\n";
463ee0b2 29
a687059c 30package ABC;
463ee0b2 31
a687059c
LW
32print $blurfl == 5 ? "ok 4\n" : "not ok 4\n";
33eval 'print $blurfl == 5 ? "ok 5\n" : "not ok 5\n";';
34eval 'package main; print $blurfl == 123 ? "ok 6\n" : "not ok 6\n";';
35print $blurfl == 5 ? "ok 7\n" : "not ok 7\n";