This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
inline AUTOLOADed constants via Exporter.pm
authorDoug MacEachern <dougm@covalent.net>
Fri, 23 Jun 2000 00:16:39 +0000 (17:16 -0700)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 28 Jun 2000 14:50:43 +0000 (14:50 +0000)
Message-ID: <Pine.LNX.4.10.10006230009400.322-100000@mojo.covalent.net>

p4raw-id: //depot/cfgperl@6251

lib/Exporter.pm

index 585109e..95076f8 100644 (file)
@@ -42,6 +42,12 @@ sub import {
       $exports{$sym} = 1;
     }
   }
+  for (@_) {
+      #need to match first to avoid "Modification of a read-only value attempted"
+      if (/^\+/ and s/^\+//) {
+          (\&{"$pkg\::$_"})->(); #try AUTOLOAD now so calls are inlined
+      }
+  }
   if ($Verbose or $Debug 
       or grep {/\W/ or $args and not exists $exports{$_}
               or @fail and $_ eq $fail[0]