From: Doug MacEachern Date: Fri, 23 Jun 2000 00:16:39 +0000 (-0700) Subject: inline AUTOLOADed constants via Exporter.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f896c48455539f30bd1893af05a97a1be7d15cf7;p=p5sagit%2Fp5-mst-13.2.git inline AUTOLOADed constants via Exporter.pm Message-ID: p4raw-id: //depot/cfgperl@6251 --- diff --git a/lib/Exporter.pm b/lib/Exporter.pm index 585109e..95076f8 100644 --- a/lib/Exporter.pm +++ b/lib/Exporter.pm @@ -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]