On Thu, 28 Feb 2008, Sisyphus wrote: > From: "Jan Dubois" <[EMAIL PROTECTED]> > > I'll probably post a script later that will search a Perl tree for modules > > with references to MSVCR71, so you can uninstall and reinstall them if you > > want to. > > I look forward to seeing that script. I don't know (and am curious as to) > how to detect that using perl - or using C, for that matter.
It is possible to do this properly by parsing the IMPORT sections of the PE file structure, but this isn't really necessary here. A brute force attempt works just as well, or probably even faster. I doubt it will generate any false positives: ####################################################################### use strict; use warnings; use File::Find qw(find); use Win32; $|++; find(sub { return unless /\.dll$/i; my $file = Win32::GetFullPathName($File::Find::name); open(my $fh, "< $file") or die "Can't open $file: $!\n"; binmode($fh); local $/; print "\U$1\E: $file\n" if <$fh> =~ /(msvcr\d\d)/i; }, scalar Win32::GetFullPathName(shift || '.') ); ####################################################################### It will also detect modules linked with MSVCR70, MSVCR80 etc. You can run the script without argument to scan the tree starting at current working directory, or provide an explicit starting point on the commandline. For various reasons it seems like the rebuild is taking a little longer, but I hope the repositories will be back up-to-date later today. Cheers, -Jan _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs