> I think it's OK to add any extra logging in the verbose mode though > (when -verbose is passed) if you find it helpful as a developer. The > verbose mode is for developers and for when users have problems, so any > extra useful info is a goodness.
yeah, that's a good idea. > >> nevertheless, it might be useful if you swapped the logic around, adding >> additional $why only if the error isn't the standard "Can't locate >> Bar.pm in >> @INC..." > > > Yes, I don't quite understand what's the added value of your patch, as > you add the extra output when it can't find the file. Where is your > supporting email, talks about the opposite case. You probably wanted > something like: > > $why .= "$@" unless $@ =~ /^Can't locate/; ken and I talked about this over irc. the issues he had seemed to stem from the fact that the error thrown from use() isn't always intuitive to non-perl folks. specifically, the error message from have_module is 'couldn't find module' which is a bit misleading - in many cases perl can "find" the module just fine, but it can't be used due to missing dependencies (ken's current problem). so, I'd suggest making the the have_module message a bit clearer, maybe something like 'module $module not available' or somesuch. also, ken pointed out that $@ will contain "Can't locate Bar.pm in @INC" if you use() Foo.pm and Foo.pm use()s Bar.pm and Bar.pm is missing. so $@ =~ /^Can't locate/; should probably be something like $@ =~ /^Can't locate $module/; or somesuch, so that a missing Foo.pm is not reported verbosely, but a missing Bar.pm is. then again, if the current behavior can be maintained and $@ printed only in -verbose mode you don't really need a regex at all. --Geoff