in reply to RE: Re: help with a Perl term
in thread help with a Perl term
or (ok, this is far fetched):eval { require DBI }; if ($@) { warn "DBI not here.. will keep checking..."; } eval { require Win32::ODBC }; if ($@) { warn "Oh oh"; } ... etc...
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
|
|---|