scooby63 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I need some help.. I have PERL on my NETSOL server. I want to use CGI::Application Module. what are my steps to use this application to access a database on my NETSOL server? Server has DBI already installed. M

Replies are listed 'Best First'.
Re: Using CPAN module
by marto (Cardinal) on Sep 28, 2010 at 09:07 UTC
Re: Using CPAN module
by oko1 (Deacon) on Sep 28, 2010 at 02:57 UTC

    Perhaps learning Perl (not 'PERL') would be a useful first step. Then, realizing that CGI::Application is a module rather than an application (despite having the word in the name), and reading and understanding its documentation would start you in the right direction. Last, but perhaps in some ways most important, writing the necessary code and showing it here if and when you run into problems would be a really good approach.

    The question you're asking is too broad to have a trivially easy answer.


    --
    "Language shapes the way we think, and determines what we can think about."
    -- B. L. Whorf
Re: Using CPAN module
by dasgar (Priest) on Sep 28, 2010 at 03:39 UTC

    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.

      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