On Sun, Jun 26, 2005 at 06:35:49PM -0700, Michael G Schwern wrote: > On Mon, Jun 27, 2005 at 05:10:02AM +0400, Alexey Tourbin wrote: > > +} or do { > > + require DynaLoader; > > + local @ISA = qw(DynaLoader); > > + bootstrap Storable $VERSION; > > +}; > > 1; > > __END__ > > # > > End of patch > > > > Since Storable is also on CPAN, the code is conditinal. "local @ISA" > > is tricky, I think I've seen this elsewhere. > > That doesn't seem right. It means Storable only inherits from DynaLoader > in the scope of that bootstrap call and I don't see why that's necessary. > It wasn't necessary before. > > "push @ISA, qw(DynaLoader)" is safer and equivalent to what was happening > before the patch.
I'm not sure. I've seen this in List::Util and I thought it was "tricky" or even "smart". After all, why being 'IS A' Dynaloader is essential for the package? Because bootstrap() calls dl_load_flags() method which can be overridden in the package (for e.g. "global loading", used in e.g. gtk2-perl.sf.net modules). After bootstrap is done, the package no longer needs to be 'IS A' DynaLoader. On the other hand, when the package does not override dl_load_flags(), bootstrap will look into %Exporter:: first and only after this will default to DynaLoader::dl_load_flags(). Looking into Exporter is basically not required.
pgprv1Y8fDdsm.pgp
Description: PGP signature