Hi,
For what it is worth, I have 'coped' with autoload issues like this in the past
with the following amendment to AutoLoader.pm
sub find_filename {
my $sub = shift;
my $filename;
# Braces used to preserve $1 et al.
{
my ($pkg,$func) = ($sub =~ /(.*)::([^:]+)$/);
$pkg =~ s#::#/#g;
if (defined($filename = $INC{"$pkg.pm"})) {
if( $filename =~ /^CODE\([^()]+\)/ ) {
$filename = qq(auto/$pkg/$func.al);
return $filename if ( DynaLoader::dl_findfile{$filename} );
}
The additional lines are the last 4.
The untested bit of this is "if ( DynaLoader::dl_findfile{$filename} );".
In my implementation I have a different method of storing the mappings of
hashed filenames.
For PAR, I imagine overriding AutoLoader::find_filename in PAR::Heavy in the
same manner that DynaLoader::dl_findfile is overridden there would work.
Regards
Mark
Scott Stanton wrote:
I have a trivial program test.pl:
use POSIX qw(strftime ceil floor);
I create a par binary like so:
pp test.pl -o test.exe
When I run it, I get the following output:
Subroutine import redefined at POSIX.pm line 21.
Subroutine croak redefined at POSIX.pm line 29.
Subroutine AUTOLOAD redefined at POSIX.pm line 39.
Subroutine DESTROY redefined at POSIX.pm line 80.
I am using perl-5.10.0 built with vc6 on Windows XP, and the 0.980
version of PAR & PAR::Packer.
Looking at the POSIX module, it does define those methods, but only
once. I wonder if there is some bleedthrough from the bootstrap process
that is causing the module to get loaded multiple times. This same
program works as expected under perl-5.8.8, so it seems likely to be a
perl-5.10 related change. Anyone have any ideas?
--Scott