Thread: Perl interface

Perl interface

From
Thomas Holmgren
Date:
Hello!

I would like to extract data from my postgreSQL7.0 database and present
them on a web-page. I want to use CGI scripts written in Perl. How do I
connect to and query the DB from Perl? A reference to a tutorial or some
sort of documentation would be highly appreciated! :))

I am familiar with both Perl and databases.


Mvh.
Thomas Holmgren
Institut for Datalogi
Aalborg Universitet


Re: Perl interface

From
Ed Loehr
Date:
Thomas Holmgren wrote:
>
> How do I connect to and query the DB from Perl?

See the DBI and DBD::Pg modules at CPAN.

Regards,
Ed Loehr

Re: Perl interface

From
Thomas Good
Date:
On Fri, 16 Jun 2000, Thomas Holmgren wrote:

> Hello!
>
> I would like to extract data from my postgreSQL7.0 database and present
> them on a web-page. I want to use CGI scripts written in Perl. How do I
> connect to and query the DB from Perl? A reference to a tutorial or some
> sort of documentation would be highly appreciated! :))
>
> I am familiar with both Perl and databases.

Hallo Thomas,

I do that for a living at the moment!  Check out my page at:
www.opensystems.org
for links to docs, sample scripts, modules, etc.

The Man, in this instance is Lincoln Stein, PhD, - he wrote CGI.pm
and has a good book:  Official Guide To Programming the CGI.pm

Do a search on Yahoo or whatever:  CGI.pm
Click on Lincoln Stein's page to find the ISBN for the book.
About $28 (perhaps less from Amazon).
My page has his scripts... ;-)

If you want to see some of my code (more involved than the rudimentary
samples) send some mail to hackers@admin.nrnet.org
Also, have a look at:  www.simtax.ca/acc - this is SQL Ledger, an
Open Source accounting package.  Dieter Simader is the author and
a nice guy as well.

Cheers,
Tom

--------------------------------------------------------------------
               SVCMC - Center for Behavioral Health
--------------------------------------------------------------------
Thomas Good                          tomg@ { admin | q8 } .nrnet.org
IS Coordinator / DBA                 Phone: 718-354-5528
                                     Fax:   718-354-5056
--------------------------------------------------------------------
Powered by:  PostgreSQL     s l a c k w a r e          FreeBSD:
               RDBMS       |---------- linux      The Power To Serve
--------------------------------------------------------------------



Re: Perl interface

From
Giles Lean
Date:
> I would like to extract data from my postgreSQL7.0 database and present
> them on a web-page. I want to use CGI scripts written in Perl. How do I
> connect to and query the DB from Perl? A reference to a tutorial or some
> sort of documentation would be highly appreciated! :))

The choices for perl/PostgresQL interfacing are DBI and DBD::Pg which
you can find on CPAN (http://www.perl.com/CPAN), and the Pg module
which you can find in src/interfaces/perl5 in the postgresql
distribution.

The Pg module is closer to libpq. The DBI interface is more portable
and has the benefit of being documented in "Programming the Perl DBI"
by Alligator Descartes and Tim Bunce.

Regards,

Giles



Re: Perl interface

From
Paul Miller
Date:
Hi Thomas,

Web programming is usually done with CGI.pm, which works nicely with
DBI.pm. This list is for postgres so I'll just point you to a website
that might get you started. Try

<http://stein.cshl.org/WWW/software/CGI/cgi_docs.html>

to get started. It takes a little getting used to, especially because
you have to reconnect for every web page (unless you get into modperl or
something--I would recommend waiting a while before digging into that).

I hope this helps...
paul

>Hello!
>
>I would like to extract data from my postgreSQL7.0 database and present

>them on a web-page. I want to use CGI scripts written in Perl. How do I

>connect to and query the DB from Perl? A reference to a tutorial or
some
>sort of documentation would be highly appreciated! :))
>
>I am familiar with both Perl and databases.
>
>
>Mvh.
>Thomas Holmgren
>Institut for Datalogi
>Aalborg Universitet