develooper Front page | perl.perl5.porters | Postings from December 2007

[PATCH] RE: How to load a "loadable object" that has a non-default file extension ?

Thread Previous | Thread Next
From:
Jan Dubois
Date:
December 30, 2007 12:53
Subject:
[PATCH] RE: How to load a "loadable object" that has a non-default file extension ?
Message ID:
18a401c84b25$e5272480$af756d80$@com
On Fri, 14 Dec 2007, Jan Dubois wrote:
> On Fri, 14 Dec 2007, Sisyphus wrote:
> 
> > I've been doing this by overwriting $DynaLoader::dl_dlext in MYMOD.pm before
> > calling bootstrap:
> >
> > ----------------------
> > {
> > local $DynaLoader::dl_dlext = 'my_ext';
> > bootstrap MYMOD $VERSION;
> > }
> > ----------------------
> >
> > And that all works fine in perl 5.8 and perl 5.6.
> >
> > But in perl 5.10, DynaLoader croaks with "Can't locate loadable object for
> > module MYMOD in @INC (@INC contains: .....". I suspect the value assigned to
> > $DynaLoader::dl_dlext is not even being looked at - and DynaLoader is trying
> > to load (the non-existent) MYMOD.dll .
> > (Was this change to DynaLoader intentional?)
> 
> It was part of change 23348:
> 
>   http://public.activestate.com/cgi-bin/perlbrowse/p/23348
> 
> The idea behind that change was to move all the platform dependent
> checking from runtime to buildtime: since DynaLoader.pm is an
> auto-generated file, there is no reason that the Win32 version
> checks $^O for any other platform at runtime.
> 
> However, I think that interpolating $dl_dlext and $dl_so at buildtime
> was a mistake; we should have retained the module variables and
> interpolated them at runtime.
> 
> I'll make a patch for this once the 5.10 code freeze is over.

Attached patch should restore the functionality to the same level as
it was in 5.6 and 5.8.

Cheers,
-Jan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About