optional 'require'

Dirk Koopman djk at tobit.co.uk
Wed Dec 21 15:21:53 GMT 2005

For some reason (probably due to old age and lack of brain brought on by
excess alcohol) I am having difficulty determining, in an optional
non-stopping way, whether DBI (and at least DBD::SQLite) is installed on
the machine.

I have an app which traditionally has used flat files and DB_File to
store the data that it has acquired. I want to allow seamless upgrade to
a SQL based version. 

Therefore I want to test for the presence of DBI and at least one true
SQL engine. However it is vital that this test is non destructive and
the app carries on as normal if these are not available.

I have tried various styles of: eval { require DBI; }; and eval "require
DBI"; so far without adequate success.

Can anyone help me?  

More information about the london.pm mailing list