in reply to RE: Re: help with a Perl term
in thread help with a Perl term

That snippet doesn't do anything if the use() fails. And, what if it is NT but Win32::ODBC isn't installed? What if it is a Win32 system with DBI installed? How about:

eval { require DBI }; if ($@) { warn "DBI not here.. will keep checking..."; } eval { require Win32::ODBC }; if ($@) { warn "Oh oh"; } ... etc...
or (ok, this is far fetched):

my %subs = ('DBI' => \&use_dbi, 'Win32::ODBC' => \&use_odbc, 'Win32::OLE' => \&use_ole ); my @mods = ('DBI', 'Win32::ODBC', 'Win32::OLE'); for (@mods) { eval { require $_ }; if ($@) { warn "No $_ here"; }else{ $subs{$_}->(); last; } }

Cheers,
KM