in reply to Re: Perl XAMPP DB Connect issue (Windows/Strawberry?)
in thread Perl XAMPP DB Connect issue (Windows/Strawberry?)

When this script ran perfectly on Mac or Linux, I was not using "DBI" either. It was "DBD::mysql" then.

I haven't used use DBI; in a long time, to be honest -- but all the while the "DBI->connect" worked just fine in my code.

Blessings,

~Polyglot~

Replies are listed 'Best First'.
Re^3: Perl XAMPP DB Connect issue (Windows/Strawberry?)
by soonix (Chancellor) on Dec 31, 2022 at 13:23 UTC
    I see DBD/mysql.pm includes "use DBI;", so it wasn't needed explicitly in your code in that case. However, even the DBD::mysql examples start out with "use DBI;", and the connect method induces loading the corresponding DBD module (instead of useing it explicitly). This way - at least for simple SQL - you could switch and mix database drivers by simply changing the connect string...

    ⇒ You might need to install DBI and/or DBD::mysql, because at least one of these two seems not to be in XAMPP's default - (see also)

      I guess my concern is that if XAMPP is doing things differently in order to get a "LAMP"-like setup working on Windows, its DB.pm package must be catered for its own setup and using another package would not guarantee success. It seems I just need to figure out the right incantations for the DB package. Fortunately, I have only the one subroutine doing the database connection, so it would be a cinch to update that and make it useful for all the routines that call it.

      Blessings,

      ~Polyglot~