Integrate perlio:
[p5sagit/p5-mst-13.2.git] / t / comp / package.t
index 456c0ff..4982256 100755 (executable)
@@ -1,11 +1,11 @@
 #!./perl
 
-print "1..7\n";
+print "1..8\n";
 
 $blurfl = 123;
 $foo = 3;
 
-package XYZ;
+package xyz;
 
 $bar = 4;
 
@@ -19,11 +19,15 @@ $ABC'dyick = 6;
 
 $xyz = 2;
 
-$main = join(':', sort(keys %::_main));
-$XYZ = join(':', sort(keys %::_XYZ));
-$ABC = join(':', sort(keys %::_ABC));
+$main = join(':', sort(keys %main::));
+$xyz = join(':', sort(keys %xyz::));
+$ABC = join(':', sort(keys %ABC::));
 
-print $XYZ eq 'ABC:XYZ:bar:main:xyz' ? "ok 1\n" : "not ok 1 '$XYZ'\n";
+if ('a' lt 'A') {
+    print $xyz eq 'bar:main:xyz:ABC' ? "ok 1\n" : "not ok 1 '$xyz'\n";
+} else {
+    print $xyz eq 'ABC:bar:main:xyz' ? "ok 1\n" : "not ok 1 '$xyz'\n";
+}    
 print $ABC eq 'blurfl:dyick' ? "ok 2\n" : "not ok 2 '$ABC'\n";
 print $main'blurfl == 123 ? "ok 3\n" : "not ok 3\n";
 
@@ -33,3 +37,17 @@ print $blurfl == 5 ? "ok 4\n" : "not ok 4\n";
 eval 'print $blurfl == 5 ? "ok 5\n" : "not ok 5\n";';
 eval 'package main; print $blurfl == 123 ? "ok 6\n" : "not ok 6\n";';
 print $blurfl == 5 ? "ok 7\n" : "not ok 7\n";
+
+package main;
+
+sub c { caller(0) }
+
+sub foo {
+   my $s = shift;
+   if ($s) {
+       package PQR;
+       main::c();
+   }
+}
+
+print((foo(1))[0] eq 'PQR' ? "ok 8\n" : "not ok 8\n");