Change 34409 by [EMAIL PROTECTED] on 2008/09/23 13:48:10
defined %{$package.''} isn't good enough to tell whether a module is
loaded when it's XS and staticly linked to perl.
Affected files ...
... //depot/perl/ext/B/B/Concise.pm#80 edit
... //depot/perl/ext/B/t/concise.t#19 edit
Differences ...
==== //depot/perl/ext/B/B/Concise.pm#80 (text) ====
Index: perl/ext/B/B/Concise.pm
--- perl/ext/B/B/Concise.pm#79~33621~ 2008-03-31 15:25:19.000000000 -0700
+++ perl/ext/B/B/Concise.pm 2008-09-23 06:48:10.000000000 -0700
@@ -14,7 +14,7 @@
use Exporter (); # use #5
-our $VERSION = "0.75";
+our $VERSION = "0.76";
our @ISA = qw(Exporter);
our @EXPORT_OK = qw( set_style set_style_standard add_callback
concise_subref concise_cv concise_main
@@ -299,7 +299,18 @@
elsif ($o =~ /^-stash=(.*)/) {
my $pkg = $1;
no strict 'refs';
- eval "require $pkg" unless defined %{$pkg.'::'};
+ if (!defined %{$pkg.'::'}) {
+ eval "require $pkg";
+ } else {
+ require Config;
+ if (!$Config::Config{usedl}
+ && keys %{$pkg.'::'} == 1
+ && $pkg->can('bootstrap')) {
+ # It is something that we're staticly linked to, but hasn't
+ # yet been used.
+ eval "require $pkg";
+ }
+ }
push @render_packs, $pkg;
}
# line-style options
==== //depot/perl/ext/B/t/concise.t#19 (text) ====
Index: perl/ext/B/t/concise.t
--- perl/ext/B/t/concise.t#18~34406~ 2008-09-23 06:31:26.000000000 -0700
+++ perl/ext/B/t/concise.t 2008-09-23 06:48:10.000000000 -0700
@@ -416,11 +416,8 @@
$out = runperl ( switches => ["-MO=Concise,-stash=Data::Dumper,-src,-exec"],
prog => '-e 1', stderr => 1 );
-{
- local $TODO = q(require $package unless ${$package.'::'}; doesn't do what
you want under static linking) unless $Config{usedl};
- like($out, qr/FUNC: \*Data::Dumper::format_refaddr/,
- "stash rendering loads package as needed");
-}
+like($out, qr/FUNC: \*Data::Dumper::format_refaddr/,
+ "stash rendering loads package as needed");
my $prog = q{package FOO; sub bar { print "bar" } package main; FOO::bar(); };
End of Patch.