There is DEFINITELY a problem Adrian...
I tried it, and got the same fail.
I looked at the d/led code, and then I d/led the package from the Gossamer site-there is a difference in the code!
This is from about line 111 in the Admin d/led scrip:
Code:
BEGIN {
if ($^C) {
eval <<'CHECK';
sub CHECK {
# ------------------------------------------------------------------------------
# In Perl 5.6+ this allows you to do: perl -cMMy::Module -e0 to make sure all
# your %COMPILE subs compile. In versions of Perl prior to 5.6, this is simply
# treated as a sub named "CHECK", w: A reference to the packages %COMPILE hash,
# the package, and the name of the function to load.
#
my ($COMPILE, $pkg, $func) = @_;
my $linenum = ($COMPILE->{$func} =~ s/^(\d+)//) ? $1+1 : 0;
eval "package $pkg;\n#line $linenum$pkg\::$func\n$COMPILE->{$func}";
if ($@) { die "Unable to load $pkg\::$func: $@" }
if (not defined &{"$pkg\::$func"}) {
die "Unable to load $pkg\::$func: Subroutine did not compile correctly (possible bad name).";
}
undef $COMPILE->{$func}; # Leave the key in the compile hash so that things can test to see if it was defined in the compile hash
return;
}
1;
This is the same area, but d/led from the site:
Code:
BEGIN {
if ($^C) {
eval <<'CHECK';
sub CHECK {
# ------------------------------------------------------------------------------
# In Perl 5.6+ this allows you to do: perl -cMMy::Module -e0 to make sure all
# your %COMPILE subs compile. In versions of Perl prior to 5.6, this is simply
# treated as a sub named "CHECK", which is never called. $^C is also 5.6+
# specific - whether or not you are running under "-c"
compile_all();
}
CHECK
}
}
sub compile_all {
my @pkg = @_;
if (@pkg) {
@pkg = grep +($PACKAGES{$_} or (warn "$_ is not loaded, does not use GT::AutoLoader, or is not a valid package" and 0)), @pkg;
@pkg or die "No valid packages passed to compile_all()!";
}
else {
@pkg = keys %PACKAGES;
} for my $pkg (@pkg) {
my $COMPILE = \%{$pkg . '::COMPILE'} or next;
for my $func (keys %$COMPILE) {
_compile($COMPILE, $pkg, $func) if $COMPILE->{$func};
}
} return 1;
} sub _compile {
# ------------------------------------------------------------------------------
# Compiles a subroutine from a module's %COMPILE into the module's package.
# die()s if the subroutine cannot compile or still does not exist after
# compiling. Takes three arguments: A reference to the packages %COMPILE hash,
# the package, and the name of the function to load.
#
my ($COMPILE, $pkg, $func) = @_;
Note, all the red stuff is missing!
dave
Big Cartoon DataBase Big Comic Book DataBase