I'm putting together a distribution that includes several modules, each with its own .xs file. But the modules have distinct version numbers (I only update the version number when a change is required in that module.)
When I built them (with Module::Build 0.28), I discovered that it used the distribution's version number when building each DLL. So it appeared to build ok, but when you tried to use the module, it would die with an object version mismatch. I was able to work around it with this method in my Module::Build subclass: sub process_xs { my $self = shift @_; my $pm_file = $_[0]; # Save the distribution version: my $dist_version = $self->dist_version; # Override it with the version number from the corresponding .pm file: $pm_file =~ s/\.xs$/.pm/i or die "$pm_file: Not an .xs file"; my $pm_info = Module::Build::ModuleInfo->new_from_file($pm_file) or die "Can't find file $pm_file to determine version"; $self->{properties}{dist_version} = $pm_info->version or die "Can't find version in $pm_file"; # Now that we've tricked dist_version into lying, process the XS file: my $result = $self->SUPER::process_xs(@_); # Restore the real dist_version: $self->{properties}{dist_version} = $dist_version; return $result; } # end process_xs Two questions: Is there a better way to do this? Is it safe to set $self->{properties}{dist_version} like that, or do I need to override the dist_version method also? Please CC me; I'm not subscribed to the list. -- Chris Madsen [EMAIL PROTECTED] -------------------- http://www.cjmweb.net --------------------