in reply to Ha! Another database question!

mdillon's response is the perl side of it. It's as easy as that. On the postgre side, don't forget to configure a user (mySQL uses a GRANT statement, and I think that's pretty much standard SQL; check your documentation) and secure it by host and password (ie. only allow that user to connect from that host with that password).

And if you're considering using this database a lot from different scripts, for the love of God, don't put the user and password and database location in each script. Write a module (My::DB or something) that connects to the database for you and returns the handle. There's no sense in having the user/pass in 15 different scripts that you then have to scrounge through when you have to change the information.

The other benefit is that you can implement connection caching and things like that, although other modules may do this more efficiently for you.

Probably a bit more information than you may have asked for, but it's good to plan these things out ahead of time before you get too far down the road and have to smack yourself in the forehead.

Replies are listed 'Best First'.
Re: Re: Ha! Another database question!
by hotyopa (Scribe) on Dec 14, 2000 at 09:44 UTC
    Thx for the tip about the module. That's something I need to do as well. Haven't written a module before - always nice to do something new :)