Help for this page

Select Code to Download


  1. or download this
    package AA;
    $AA::var = __PACKAGE__;
    ...
    package BB;
    $BB::var = __PACKAGE__;
    print "$var\n";         # Prints 'AA'.
    
  2. or download this
    {
       package AA;
    ...
       $BB::var = __PACKAGE__;
       print "$var\n";         # Compile error!
    }