Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Constants
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23602/Win32-GUI-Constants

Modified Files:
        Constants.pm 
Log Message:
Fix for backwards compatibility with CONSTNAME barewords

Index: Constants.pm
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Constants/Constants.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Constants.pm        17 May 2006 21:14:54 -0000      1.2
--- Constants.pm        17 May 2006 22:15:02 -0000      1.3
***************
*** 109,112 ****
--- 109,113 ----
      my $autoload = 0;
      my $oops = 0;
+     my $compatibility_win32_gui = 0;
  
  =head1 PRAGMATA
***************
*** 197,205 ****
                          next;
                      }
!                   # :compatibility_win32_gui has very special semantics if
!                   # the calling package is Win32::GUI for backwards 
compatibility
!                   if (($spec eq 'compatibility_win32_gui') and (caller eq 
'Win32::GUI')) {
!                         $pkg = 'Win32::GUI';
!                   }
                  }
                  elsif ($spec =~ m:^/(.*)/$:){
--- 198,206 ----
                          next;
                      }
!                     # :compatibility_win32_gui has very special semantics if
!                     # the calling package is Win32::GUI for backwards 
compatibility
!                     if (($spec eq 'compatibility_win32_gui') and (caller eq 
'Win32::GUI')) {
!                         $compatibility_win32_gui = 1;
!                     }
                  }
                  elsif ($spec =~ m:^/(.*)/$:){
***************
*** 214,218 ****
                  }
  
!               #XXX warn "Import ".($remove ? "del":"add").": @names " if 
$Verbose;
  
                  if ($remove) {
--- 215,219 ----
                  }
  
!                 warn "Import ".($remove ? "del":"add").": @names " if 
$Verbose;
  
                  if ($remove) {
***************
*** 236,241 ****
      # export @imports to caller's namespace
      if($Verbose) {
!         #XXX my $t = join(", ", sort @imports) . "\n" . scalar(@imports) . " 
symbols being ";
!       my $t = scalar(@imports) . " symbols being ";
          $t   .= "imported into $callpkg from $pkg " if $export;
          $t   .= "and " if $export and $inline;
--- 237,241 ----
      # export @imports to caller's namespace
      if($Verbose) {
!         my $t = join(", ", sort @imports) . "\n" . scalar(@imports) . " 
symbols being ";
          $t   .= "imported into $callpkg from $pkg " if $export;
          $t   .= "and " if $export and $inline;
***************
*** 259,262 ****
--- 259,263 ----
              *{"${callpkg}::$sym"} = \&{"${pkg}::$sym"} if $export;
              &{"${pkg}::$sym"} if $inline;  # force AUTOLOAD
+             eval "sub Win32::GUI::$sym();" if $compatibility_win32_gui;
          }
  


Reply via email to