in reply to Using CPAN module

Well, first of all, that module doesn't interact with databases.

As for steps for interacting with a database, here you go:

  1. Determine what database you're using. (MySQL, Oracle, etc.)
  2. Install the DBI module if it is not already installed. (Looks like you don't have to worry about this step.)
  3. Install the appropriate DBD module that works with your database. (Ex: DBD::mysql for MySQL, DBD::Oracle for Oracle, etc.)

That's the general idea of what to do. Since I haven't tried connecting to databases yet, there's a chance that more experienced monks might point out things that I missed.

Replies are listed 'Best First'.
Re^2: Using CPAN module
by oko1 (Deacon) on Sep 28, 2010 at 04:47 UTC

    You missed the part where you study 'perldoc DBI' until you're ready to fall over, and then give up programming forever to become a mercenary in the wild African jungles because it's a much easier way to make a living. Otherwise, you've got it spot on. :)

    # Or it can be as easy as... perl -MDBI -wle 'print for DBI->connect("dbi:mysql:foo")->selectrow_ar +ray("SELECT * FROM xyz")'

    --
    "Language shapes the way we think, and determines what we can think about."
    -- B. L. Whorf